You are here

function date_get_timezone in Date 6.2

Same name and namespace in other branches
  1. 8 date_api/date_api.module \date_get_timezone()
  2. 5.2 date_api.module \date_get_timezone()
  3. 5 date.inc \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

6 calls to date_get_timezone()
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_repeat_build_dates in date/date_repeat.inc
Helper function to build repeating dates from a $node_field.
_date_content_generate in date/date_content_generate.inc
Implementation of Devel module's hook_content_generate().

... See full list

File

./date_api.module, line 1847
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();
}