function drupal_get_user_timezone

Returns the time zone of the current user.

15 calls to drupal_get_user_timezone()

File

drupal/core/includes/bootstrap.inc, line 1902
Functions that need to be loaded on every Drupal request.

Code

function drupal_get_user_timezone() {
  global $user;
  $config = config('system.timezone');
  if ($config
    ->get('user.configurable') && $user->uid && $user->timezone) {
    return $user->timezone;
  }
  else {

    // Ignore PHP strict notice if time zone has not yet been set in the php.ini
    // configuration.
    $config_data_default_timezone = $config
      ->get('default');
    return !empty($config_data_default_timezone) ? $config_data_default_timezone : @date_default_timezone_get();
  }
}