Although a long term fix needs to allow calendar artefacts
(specifically reminders which get triggered by cron) to
reflect local times for each user, this short term patch
will let you adjust the server timezone to reflect a single
timezone for the majority of your users.
* IMPORTANT * Only works for PHP version 5.1 or higher.
------- ADD THE FOLLOWING TO YOUR CONFIG.PHP FILE --------
// which timezone the server should be acting on - must be
from the list of supported timezones
// ... see http://www.php.net/manual/en/timezones.php
// IMPORTANT: only works if your server is using PHP
version 5.1 or greater
$cfg->servertimezone = 'America/New_York';
//$cfg->servertimezone = 'Pacific/Auckland';
//$cfg->servertimezone = 'Europe/London';
//$cfg->servertimezone = 'Asia/Tokyo';
--------- ADD THE FOLLOWING TO INIT.PHP AT AROUND LINE 62 -
AFTER config.php and config-default.php are processed ------
// fix server timezone, if needed (only works for PHP v5.1
or higher)
if (function_exists("date_default_timezone_set") and
function_exists("date_default_timezone_get")) {
$CFG->defaultservertimezone = date_default_timezone_get();
$CFG->originalservertimezone = $CFG->defaultservertimezone;
if (isset($CFG->servertimezone)) {
try { date_default_timezone_set($CFG->servertimezone); $CFG->currentservertimezone =
date_default_timezone_get();
} catch (Exception $e) {
if ($e instanceof ConfigSanityException) {
throw $e;
}
$errormessage = ob_get_contents();
if (!$errormessage) { $errormessage = $e->getMessage();
}
ob_end_clean();
$errormessage = get_string('servertimezonefailed',
'error') . $errormessage;
throw new ConfigSanityException($errormessage);
}
} else { $CFG->currentservertimezone =
date_default_timezone_get();
}
}
Although a long term fix needs to allow calendar artefacts
(specifically reminders which get triggered by cron) to
reflect local times for each user, this short term patch
will let you adjust the server timezone to reflect a single
timezone for the majority of your users.
* IMPORTANT * Only works for PHP version 5.1 or higher.
------- ADD THE FOLLOWING TO YOUR CONFIG.PHP FILE --------
// which timezone the server should be acting on - must be www.php. net/manual/ en/timezones. php ezone = 'America/New_York'; >servertimezone = 'Pacific/Auckland'; >servertimezone = 'Europe/London'; >servertimezone = 'Asia/Tokyo';
from the list of supported timezones
// ... see http://
// IMPORTANT: only works if your server is using PHP
version 5.1 or greater
$cfg->servertim
//$cfg-
//$cfg-
//$cfg-
--------- ADD THE FOLLOWING TO INIT.PHP AT AROUND LINE 62 -
AFTER config.php and config-default.php are processed ------
// fix server timezone, if needed (only works for PHP v5.1 exists( "date_default_ timezone_ set") and exists( "date_default_ timezone_ get")) { >defaultservert imezone = date_default_ timezone_ get(); >originalserver timezone = $CFG->defaultse rvertimezone; $CFG->servertim ezone)) {
date_ default_ timezone_ set($CFG- >servertimezone );
$CFG- >currentservert imezone = timezone_ get(); eption) {
$errormessag e = $e->getMessage(); end_clean( ); 'servertimezone failed' , eption( $errormessage) ;
$CFG-> currentserverti mezone = timezone_ get();
or higher)
if (function_
function_
$CFG-
$CFG-
if (isset(
try {
date_default_
} catch (Exception $e) {
if ($e instanceof ConfigSanityExc
throw $e;
}
$errormessage = ob_get_contents();
if (!$errormessage) {
}
ob_
$errormessage = get_string(
'error') . $errormessage;
throw new ConfigSanityExc
}
} else {
date_default_
}
}