You are here

function date_default_timezone_name in Date 5.2

Same name and namespace in other branches
  1. 5 date_api.module \date_default_timezone_name()
  2. 6.2 date_api.module \date_default_timezone_name()
  3. 6 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.

28 calls to date_default_timezone_name()
date_copy_convert_events in date_copy/date_copy.module
date_date in date_php4/date_php4.inc
Return formatted date based on timestamp $timestamp.
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_generate in date/date_content_generate.inc

... 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_api_set_variables in ./date_api.install
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_menu in date_timezone/date_timezone.module
Make sure a timezone has been selected.

... See full list

File

./date_api.module, line 691
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;
  }
}