function clock_get_timezone in Clock 6
Gets the correct time zone.
Parameters
$date_format_date: Whether or not the returned time zone is directly used in date_format_date(). Defaults to FALSE.
Return value
A string containing the time zone name or NULL if the time zone type is 'User time zone'. If the time zone type is 'Local time zone' the string 'Local' is returned.
1 call to clock_get_timezone()
- clock_block in ./
clock.module - Implements hook_block().
File
- ./
clock.module, line 212 - Functions to manage the display of a clock.
Code
function clock_get_timezone($date_format_date = FALSE) {
$timezone_type = variable_get('clock_timezone_type', '1');
switch ($timezone_type) {
// Site time zone.
case '1':
$timezone = variable_get('date_default_timezone_name', 'UTC');
break;
// User time zone.
case '2':
$timezone = NULL;
break;
// Local time zone.
case '3':
$timezone = $date_format_date ? variable_get('date_default_timezone_name', 'UTC') : 'Local';
break;
// Custom time zone.
case '4':
$timezone = variable_get('clock_custom_timezone', 'UTC');
break;
}
return $timezone;
}