Extend the range of allowable timezones up to 13 hours ... (NZ Daylight savings)

This commit is contained in:
moodler 2002-11-15 02:46:48 +00:00
parent cc94d11b83
commit 0431bd7c73
2 changed files with 7 additions and 7 deletions

View 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) {

View 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) {