1 date.inc date_timezone_abbr($refresh = FALSE)

Returns an array of system-allowed timezone abbreviations.

Cache an array of just the abbreviation names because the whole timezone_abbreviations_list() is huge, so we don't want to retrieve it more than necessary.

Parameters

bool $refresh: (optional) Whether to refresh the list. Defaults to TRUE.

Return value

array: An array of allowed timezone abbreviations.

File

core/includes/date.inc, line 593
Date API functions.

Code

function date_timezone_abbr($refresh = FALSE) {
  $cached = cache_get('date_timezone_abbreviations');
  $data = isset($cached->data) ? $cached->data : array();
  if (empty($data) || $refresh) {
    $data = array_keys(timezone_abbreviations_list());
    cache_set('date_timezone_abbreviations', $data);
  }
  return $data;
}