Merged changes from STABLE for timezone display

This commit is contained in:
moodler 2004-08-25 08:52:14 +00:00
parent d64bc8aea6
commit 601131c169
4 changed files with 13 additions and 9 deletions

View File

@ -50,16 +50,17 @@
$config->timezone = 99;
}
$timenow = time();
$timeformat = get_string('strftimedaytime');
for ($tz = -26; $tz <= 26; $tz++) {
$zone = (float)$tz/2.0;
$usertime = $timenow + ($tz * 1800);
if ($tz == 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT)";
} else if ($tz < 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT$zone)";
} else {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT+$zone)";
}
}

View File

@ -33,16 +33,17 @@
$user->timezone = 99;
}
$timenow = time();
$timeformat = get_string('strftimedaytime');
for ($tz = -26; $tz <= 26; $tz++) {
$zone = (float)$tz/2.0;
$usertime = $timenow + ($tz * 1800);
if ($tz == 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT)";
} else if ($tz < 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT$zone)";
} else {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT+$zone)";
}
}

View File

@ -904,6 +904,7 @@ $string['strftimemonthyear'] = '%%B %%Y';
$string['strftimerecent'] = '%%d %%b, %%H:%%M';
$string['strftimerecentfull'] = '%%a, %%d %%b %%Y, %%I:%%M %%p';
$string['strftimetime'] = '%%I:%%M %%p';
$string['strftimedaytime'] = '%%a, %%H:%%M';
$string['stringsnotset'] = 'The following strings are not defined in $a';
$string['studentnotallowed'] = 'Sorry, but you can not enter this course as \'$a\'';
$string['students'] = 'Students';

View File

@ -164,16 +164,17 @@ if (isadmin()) {
$user->timezone = 99;
}
$timenow = time();
$timeformat = get_string('strftimedaytime');
for ($tz = -26; $tz <= 26; $tz++) {
$zone = (float)$tz/2.0;
$usertime = $timenow + ($tz * 1800);
if ($tz == 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT)";
} else if ($tz < 0) {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT$zone)";
} else {
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
$timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT+$zone)";
}
}