You are here

function date_default_timezone_name in Date 6

Same name and namespace in other branches
  1. 5.2 date_api.module \date_default_timezone_name()
  2. 5 date_api.module \date_default_timezone_name()
  3. 6.2 date_api.module \date_default_timezone_name()

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.

16 calls to date_default_timezone_name()
date_api_argument_handler::get_query_fields in ./date_api.views.inc
date_copy_convert_events in date_copy/date_copy.module
date_default_timezone in ./date_api.module
A timezone object for the default timezone.
date_formatter_process in date/date.module
Helper function for creating formatted date arrays from a formatter.
date_get_timezone in date/date.module
Function to figure out which timezone applies to a date and select it

... See full list

11 string references to 'date_default_timezone_name'
date_api_requirements in ./date_api.install
Implementation of hook_requirements(). Make sure Date PHP4 is installed if running less than PHP 5.2.
date_ical_parse_duration in ./date_api_ical.inc
Parse the duration of the event. Example: DURATION:PT1H30M DURATION:P1Y2M
date_timezone_cron in date_timezone/date_timezone.module
Update the site timezone offset when cron runs.
date_timezone_init in date_timezone/date_timezone.module
Make sure a timezone has been selected.
date_timezone_module_uninstall in date_timezone/date_timezone.install

... See full list

File

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