By jhedstrom on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.1.x
Introduced in version:
10.1.0
Description:
system_time_zones() is deprecated. The best replacement depends on the actual usage, especially whether the second parameter of the method is set to TRUE (default is FALSE).
| Before | After | Notes |
|---|---|---|
system_time_zones() |
\Drupal\Core\Datetime\TimeZoneFormHelper::getOptionsList() |
Use, if you need an ungrouped list of time zones (default behaviour of system_time_zones()). |
system_time_zones(FALSE, TRUE) |
\Drupal\Core\Datetime\TimeZoneFormHelper::getOptionsListByRegion() |
Use, if you need a list of time zones grouped by region (i.e. if you set the second parameter $grouped to TRUE). |
array_keys(system_time_zones()); |
\DateTimeZone::listIdentifiers() |
Use, if you only need the time zone identifiers. |
Impacts:
Module developers
Themers
Site templates, recipes and distribution developers
Comments
alter?
All this work to change how the TZ list is generated; but still no way to alter the list?
Peter Lindstrom
LiquidCMS - Content Solution Experts