From 3c17d392f2a148c7fa48b3ec74db11e0630545d8 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Thu, 30 Oct 2003 19:16:44 +0000
Subject: [PATCH] - Added support for "special timezones".  Patch by
 Steven/UnConeD.

---
 modules/system.module        | 6 +++++-
 modules/system/system.module | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/system.module b/modules/system.module
index e43e2d4e9a2c..a32c00ac3723 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 e43e2d4e9a2c..a32c00ac3723 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."));
   }
 
-- 
GitLab