function _clock_get_timezone in Clock 7
Gets the correct timezone to display.
Parameters
$date_format_date: Whether or not the returned time zone is directly used in date_format_date(). Defaults to FALSE.
Return value
The name of the timezone, NULL if the user's time zone is to be used or 'Local' if the user's local time is to be used.
2 calls to _clock_get_timezone()
- clock_block_configure in ./
clock.module - Implement hook_block_configure().
- clock_block_view in ./
clock.module - Implements hook_block_view().
File
- ./
clock.module, line 180
Code
function _clock_get_timezone($date_format_date = FALSE) {
$time_zone = variable_get('clock_time_zone', 2);
switch ($time_zone) {
// Site time zone.
case 1:
$time_zone = variable_get('date_default_timezone', 'UTC');
break;
// User time zone.
case 2:
$time_zone = NULL;
break;
// Local time zone.
case 3:
$time_zone = $date_format_date ? variable_get('date_default_timezone', 'UTC') : 'Local';
break;
}
// If the time zone type is 'Custom time zone', $time_zone directly contains
// the name of the time zone.
return $time_zone;
}