function system_time_zones

Same name in other branches
  1. 7.x modules/system/system.module \system_time_zones()
  2. 9 core/modules/system/system.module \system_time_zones()
  3. 8.9.x core/modules/system/system.module \system_time_zones()

Generate an array of time zones and their local time&date.

Parameters

mixed $blank: If evaluates true, prepend an empty time zone option to the array.

bool $grouped: (optional) Whether the timezones should be grouped by region.

Return value

array An array or nested array containing time zones, keyed by the system name.

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. This function is no longer used in Drupal core. Use \Drupal\Core\Datetime\TimeZoneFormHelper::getOptionsList() or \DateTimeZone::listIdentifiers() instead.

See also

https://www.drupal.org/node/3023528

1 call to system_time_zones()
SystemFunctionsLegacyTest::testSystemTimeZones in core/modules/system/tests/src/Kernel/System/SystemFunctionsLegacyTest.php
@covers ::system_time_zones

File

core/modules/system/system.module, line 1076

Code

function system_time_zones($blank = NULL, $grouped = FALSE) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. This function is no longer used in Drupal core. Use \\Drupal\\Core\\Datetime\\TimeZoneFormHelper::getOptionsList(), \\Drupal\\Core\\Datetime\\TimeZoneFormHelper::getOptionsListByRegion() or \\DateTimeZone::listIdentifiers() instead. See https://www.drupal.org/node/3023528', E_USER_DEPRECATED);
    return $grouped ? TimeZoneFormHelper::getOptionsListByRegion((bool) $blank) : TimeZoneFormHelper::getOptionsList((bool) $blank);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.