diff --git a/modules/system.module b/modules/system.module index e43e2d4e9a2cf22d46b7539ad47bde028e1e20a2..a32c00ac3723f44f7b43409bc8f1754c0853b72f 100644 --- a/modules/system.module +++ b/modules/system.module @@ -88,7 +88,11 @@ function system_user($type, &$edit, $user) { $output .= form_item(t("Theme"), "", t("Selecting a different theme will change the look and feel of the site.")); } if ($type == "edit_form") { - for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date(variable_get("date_format_long", "l, F dS, Y - g:ia"), time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")"; + $zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14); + foreach ($zonelist as $offset) { + $zone = $offset * 3600; + $zones["$zone"] = date(variable_get("date_format_long", "l, F dS, Y - g:ia"), time() - date("Z") + $zone) . sprintf(" (GMT %s%02d:%02d)\n", ($offset >= 0) ? "+" : "-", floor(abs($offset)), (abs($offset) * 60) % 60); + } $output .= form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate.")); } diff --git a/modules/system/system.module b/modules/system/system.module index e43e2d4e9a2cf22d46b7539ad47bde028e1e20a2..a32c00ac3723f44f7b43409bc8f1754c0853b72f 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -88,7 +88,11 @@ function system_user($type, &$edit, $user) { $output .= form_item(t("Theme"), "", t("Selecting a different theme will change the look and feel of the site.")); } if ($type == "edit_form") { - for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date(variable_get("date_format_long", "l, F dS, Y - g:ia"), time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")"; + $zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14); + foreach ($zonelist as $offset) { + $zone = $offset * 3600; + $zones["$zone"] = date(variable_get("date_format_long", "l, F dS, Y - g:ia"), time() - date("Z") + $zone) . sprintf(" (GMT %s%02d:%02d)\n", ($offset >= 0) ? "+" : "-", floor(abs($offset)), (abs($offset) * 60) % 60); + } $output .= form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate.")); }