From 0431bd7c7322f50ddaa932f17451a3506f0680fc Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 15 Nov 2002 02:46:48 +0000 Subject: [PATCH] Extend the range of allowable timezones up to 13 hours ... (NZ Daylight savings) --- lib/moodlelib.php | 10 +++++----- user/edit.html | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 7b31b62288c..faf6b09966d 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -534,7 +534,7 @@ function userdate($date, $format="", $timezone=99) { $timezone = (float)$USER->timezone; } } - if (abs($timezone) > 12) { + if (abs($timezone) > 13) { return strftime("$format", $date); } return gmstrftime($format, $date + (int)($timezone * 3600)); @@ -549,7 +549,7 @@ function usergetdate($date, $timezone=99) { if ($timezone == 99) { $timezone = (float)$USER->timezone; } - if (abs($timezone) > 12) { + if (abs($timezone) > 13) { return getdate($date); } //There is no gmgetdate so I have to fake it... @@ -575,7 +575,7 @@ function usertime($date, $timezone=99) { if ($timezone == 99) { $timezone = (float)$USER->timezone; } - if (abs($timezone) > 12) { + if (abs($timezone) > 13) { return $date; } return $date - (int)($timezone * 3600); @@ -592,7 +592,7 @@ function usergetmidnight($date, $timezone=99) { $userdate = usergetdate($date, $timezone); - if (abs($timezone) > 12) { + if (abs($timezone) > 13) { return mktime(0, 0, 0, $userdate["mon"], $userdate["mday"], $userdate["year"]); } @@ -608,7 +608,7 @@ function usertimezone($timezone=99) { if ($timezone == 99) { $timezone = (float)$USER->timezone; } - if (abs($timezone) > 12) { + if (abs($timezone) > 13) { return "server time"; } if (abs($timezone) < 0.5) { diff --git a/user/edit.html b/user/edit.html index 0d1dd7cc5e8..7931c62a8a4 100644 --- a/user/edit.html +++ b/user/edit.html @@ -99,12 +99,12 @@ if (isadmin()) {

: timezone) > 12) { + if (abs($user->timezone) > 13) { $user->timezone = 99; } $timenow = time(); - for ($tz = -23; $tz <= 24; $tz++) { + for ($tz = -26; $tz <= 26; $tz++) { $zone = (float)$tz/2.0; $usertime = $timenow + ($tz * 1800); if ($tz == 0) {