$zone_city) { $date = new DateTime(NULL, new DateTimeZone($zone)); $offset = $date->getOffset() / 3600; $timezone_array[$zone] = '(GMT'.($offset < 0 ? $offset : '+'.$offset).') '.$zone_city; } $options = [ 'inline' => TRUE, 'options' => $timezone_array, ] + $options; $user_fields = form_select('user_timezone', $locale['uf_timezone'], $field_value, $options); // Display in profile } else if ($profile_method == "display") { if (!empty($field_value)) { $date = new DateTime(NULL, new DateTimeZone($field_value)); $offset = $date->getOffset() / 3600; $field_value = 'GMT'.($offset < 0 ? $offset : '+'.$offset); $user_fields = [ 'title' => $locale['uf_timezone'], 'value' => $field_value ]; } }