You are here

function date_default_timezone in Date 7

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

Return a timezone name to use as a default.

Return value

a timezone name Identify the default timezone for a user, if available, otherwise the site. Must return a value even if no timezone info has been set up.

18 calls to date_default_timezone()
date_default_timezone_object in date_api/date_api.module
A timezone object for the default timezone.
date_devel_generate in ./date.devel_generate.inc
Implementation of Devel module's hook_content_generate().
date_field_widget_form in ./date_elements.inc
Private implementation of hook_widget().
date_formatter_process in ./date.module
Helper function for creating formatted date arrays from a formatter.
date_get_timezone in date_api/date_api.module
Function to figure out which local timezone applies to a date and select it

... See full list

1 string reference to 'date_default_timezone'
date_ical_parse_duration in date_api/date_api_ical.inc
Parse the duration of the event. Example: DURATION:PT1H30M DURATION:P1Y2M

File

date_api/date_api.module, line 1304
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_default_timezone($check_user = TRUE) {
  global $user;
  if ($check_user && variable_get('configurable_timezones', 1) && !empty($user->timezone)) {
    return $user->timezone;
  }
  else {
    $default = variable_get('date_default_timezone', '');
    return empty($default) ? 'UTC' : $default;
  }
}