function date_get_timezone_db

nittany7 date_api.module date_get_timezone_db($handling, $timezone = '')
cis7 date_api.module date_get_timezone_db($handling, $timezone = '')
mooc7 date_api.module date_get_timezone_db($handling, $timezone = '')

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

Parameters

string $handling: The timezone handling.

string $timezone: (optional) A timezone string. Defaults to an empty string.

Return value

string The timezone string.

22 calls to date_get_timezone_db()
DateFieldBasic::createDateField in modules/contrib/date/tests/date_field.test
Creates a date field from an array of settings values.
date_combo_validate in modules/contrib/date/date_elements.inc
Validate and update a combo element. Don't try this if there were errors before reaching this point.
date_context_date_condition::execute in modules/contrib/date/date_context/plugins/date_context_date_condition.inc
date_default_value in modules/contrib/date/date_elements.inc
The callback for setting a default value for an empty date field.
date_default_value_part in modules/contrib/date/date_elements.inc
Helper function for the date default value callback to set either 'value' or 'value2' to its default value.

... See full list

File

modules/contrib/date/date_api/date_api.module, line 2333
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_db($handling, $timezone = '') {
  switch ($handling) {
    case 'none':
      $timezone = date_default_timezone();
      break;
    default:
      $timezone = 'UTC';
      break;
  }
  return $timezone > '' ? $timezone : 'UTC';
}