You are here

function date_get_timezone in Date 5.2

Same name and namespace in other branches
  1. 8 date_api/date_api.module \date_get_timezone()
  2. 5 date.inc \date_get_timezone()
  3. 6.2 date_api.module \date_get_timezone()
  4. 6 date/date.module \date_get_timezone()
  5. 7.3 date_api/date_api.module \date_get_timezone()
  6. 7 date_api/date_api.module \date_get_timezone()
  7. 7.2 date_api/date_api.module \date_get_timezone()

Function to figure out which local timezone applies to a date and select it

9 calls to date_get_timezone()
date_data_integrity in date/date.install
Progressive update of date information, integrity checking of all date values.
date_field in date/date.module
Implementation of hook_field().
date_field_get_sql_handler in date/date.module
Generate a DateAPI SQL handler for the given CCK date field.
date_formatter_process in date/date.module
Helper function for creating formatted date arrays from a formatter.
date_prepare_node in date/date.module
Helper function to adapt multiple date fields on a node to view parameters.

... See full list

File

./date_api.module, line 1545
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_name();
      break;
    case 'utc':
      $timezone = 'UTC';
      break;
    default:
      $timezone = date_default_timezone_name();
  }
  return $timezone > '' ? $timezone : date_default_timezone_name();
}