You are here

function date_get_timezone in Date 5

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. 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 timezone applies to a date and select it

5 calls to date_get_timezone()
date_data_integrity in ./date.install
Progressive update of date information, integrity checking of all date values.
date_field_object in ./date.module
Use the Date API to get an object representation of a date field
date_output_options in ./date.inc
Function to create an option list that will display various date and time formats
date_widget in ./date.module
Implementation of hook_widget().
_date_pathauto_node in ./date_pathauto.inc

File

./date.inc, line 631
Date/time API functions

Code

function date_get_timezone($handling, $timezone = '') {
  switch ($handling) {
    case 'site':
      $timezone_out = date_get_site_timezone();
      break;
    case 'date':
      $timezone_out = $timezone > '' ? $timezone : date_get_site_timezone();
      break;
    case 'user':

    // come back here and add appropriate value if user timezones are can be collected and saved
    // until then, user option is not enabled
    case 'none':
      $timezone_out = 'none';
      break;
    default:
      $timezone_out = 'GMT';
  }
  return $timezone_out > '' ? $timezone_out : 'GMT';
}