summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2003-10-30 19:16:44 (GMT)
committer Dries Buytaert2003-10-30 19:16:44 (GMT)
commit3c17d392f2a148c7fa48b3ec74db11e0630545d8 (patch)
tree2f257f8afb8e46d405a456ba1d35dd571d6205df
parent8f9a19b340530c9a450909cffd4a580b727d16f9 (diff)
- Added support for "special timezones". Patch by Steven/UnConeD.
-rw-r--r--modules/system.module6
-rw-r--r--modules/system/system.module6
2 files changed, 10 insertions, 2 deletions
diff --git a/modules/system.module b/modules/system.module
index e43e2d4..a32c00a 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -88,7 +88,11 @@ function system_user($type, &$edit, $user) {
$output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", 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 e43e2d4..a32c00a 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"), "<select name=\"edit[theme]\">$options</select>", 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."));
}