You are here

function date_default_timezone_name in Date 5

Same name and namespace in other branches
  1. 5.2 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()

We do this in lots of places, so make it a function.

Return value

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

4 string references to 'date_default_timezone_name'
date_formatter_setup_form in ./date_admin.inc
A form to create a date formatter option
date_get_site_timezone in ./date.inc
Get system variable setting for site default timezone
date_ical_parse_duration in ./date_api_ical.inc
Parse the duration of the event.
date_set_site_timezone in ./date.inc
Set system variable for site default timezone Needed because current system variable tracks offset rather than timezone

File

./date_api.module, line 88
A module that will make the date API available to other modules with no dependencies on CCK. To use it, install the module, then add the following code wherever date api functions are needed:

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 {
    return variable_get('date_default_timezone_name', '');
  }
}