function date_timezone_cron in Date 6
Same name and namespace in other branches
- 5.2 date_timezone/date_timezone.module \date_timezone_cron()
- 6.2 date_timezone/date_timezone.module \date_timezone_cron()
Update the site timezone offset when cron runs.
This is to make sure that modules that rely on the timezone offset have current information to process.
File
- date_timezone/
date_timezone.module, line 126 - This module will make the alter the user and site timezone forms to select a timezone name instead of a timezone offset.
Code
function date_timezone_cron() {
$date = date_now(variable_get('date_default_timezone_name', NULL));
$offset = date_offset_get($date);
if ($offset != variable_get('date_default_timezone', 0)) {
variable_set('date_default_timezone', $offset);
}
}