function date_get_timezone in Date 7
Same name and namespace in other branches
- 8 date_api/date_api.module \date_get_timezone()
- 5.2 date_api.module \date_get_timezone()
- 5 date.inc \date_get_timezone()
- 6.2 date_api.module \date_get_timezone()
- 6 date/date.module \date_get_timezone()
- 7.3 date_api/date_api.module \date_get_timezone()
- 7.2 date_api/date_api.module \date_get_timezone()
Function to figure out which local timezone applies to a date and select it
7 calls to date_get_timezone()
- date_devel_generate in ./
date.devel_generate.inc - Implementation of Devel module's hook_content_generate().
- date_field_get_sql_handler in ./
date.module - Generate a DateAPI SQL handler for the given CCK date field.
- date_field_load in ./
date.field.inc - Implements hook_field_load().
- date_field_update in ./
date.field.inc - Implements hook_field_update().
- date_field_widget_form in ./
date_elements.inc - Private implementation of hook_widget().
File
- date_api/
date_api.module, line 1777 - This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.
Code
function date_get_timezone($handling, $timezone = '') {
switch ($handling) {
case 'date':
$timezone = !empty($timezone) ? $timezone : date_default_timezone();
break;
case 'utc':
$timezone = 'UTC';
break;
default:
$timezone = date_default_timezone();
}
return $timezone > '' ? $timezone : date_default_timezone();
}