]> git.mjollnir.org Git - moodle.git/commitdiff
Extend the range of allowable timezones up to 13 hours ... (NZ Daylight savings)
authormoodler <moodler>
Fri, 15 Nov 2002 02:46:48 +0000 (02:46 +0000)
committermoodler <moodler>
Fri, 15 Nov 2002 02:46:48 +0000 (02:46 +0000)
lib/moodlelib.php
user/edit.html

index 7b31b62288cd83e3fa411e0d3ee5645862393624..faf6b09966dff963ae7f639ac49d8b147886ef07 100644 (file)
@@ -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) {
index 0d1dd7cc5e830b42633c9172121cb6b54abb79eb..7931c62a8a4afedb916bff57b3dbc92030eb1b6e 100644 (file)
@@ -99,12 +99,12 @@ if (isadmin()) {
 <tr valign=top>
        <td><P><? print_string("timezone") ?>:</td>
        <td><?
-       if (abs($user->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) {