You are here

function date_get_timezone_db in Date 8

Same name and namespace in other branches
  1. 5.2 date_api.module \date_get_timezone_db()
  2. 6.2 date_api.module \date_get_timezone_db()
  3. 7.3 date_api/date_api.module \date_get_timezone_db()
  4. 7 date_api/date_api.module \date_get_timezone_db()
  5. 7.2 date_api/date_api.module \date_get_timezone_db()

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.

24 calls to date_get_timezone_db()
DateFieldBase::createDateField in lib/Drupal/date/Tests/DateFieldBase.php
Creates a date field from an array of settings values.
DateFieldBase::createDateField in date_field/lib/Drupal/date_field/Tests/DateFieldBase.php
Creates a date field from an array of settings values.
date_combo_validate in ./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 date_context/plugins/date_context_date_condition.inc
date_default_value in ./date.module
The callback for setting a default value for an empty date field.

... See full list

File

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