mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
A new configuration setting so that the admin can define the site's default
timezone.
This commit is contained in:
parent
90207a06e3
commit
d6582c7cac
3 changed files with 29 additions and 0 deletions
|
@ -43,6 +43,33 @@
|
|||
<?php print_string("configlocale") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>timezone:</td>
|
||||
<td><?php
|
||||
if (abs($config->timezone) > 13) {
|
||||
$config->timezone = 99;
|
||||
}
|
||||
$timenow = time();
|
||||
|
||||
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)";
|
||||
} else if ($tz < 0) {
|
||||
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
|
||||
} else {
|
||||
$timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
|
||||
}
|
||||
}
|
||||
|
||||
choose_from_menu ($timezones, "timezone", $config->timezone, get_string("serverlocaltime"), "", "99");
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print_string("configtimezone") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align=right><p>country:</td>
|
||||
<td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue