DateTimeZone::listIdentifiers

PHP 5 >= 5.2.0, PHP 7, PHP 8
DateTimeZone::listIdentifiers - Returns a numerically indexed array containing all defined timezone identifiers
Manual
Code Examples

DateTimeZone::listIdentifiers(
     [int$timezoneGroup = DateTimeZone::ALL],
     [string|null$countryCode = null]
): public static array

Procedural style

arraytimezone_identifiers_list inttimezoneGroupDateTimeZone::ALL stringnullcountryCodenull

Parameters

timezoneGroup

One of the DateTimeZone class constants (or a combination).

countryCode

A two-letter ISO 3166-1 compatible country code.

Note:

This option is only used when timezoneGroup is set to DateTimeZone::PER_COUNTRY.

Return Values

Returns the array of timezone identifiers.

Changelog

Version Description
8.0.0 Prior to this version, false was returned on failure.
7.1.0 countryCode is nullable now.

Related Functions

Example of DateTimeZone::listIdentifiers

Show all examples for DateTimeZone::listIdentifiers

PHP Version:


Function DateTimeZone::listIdentifiers:

Date and Time Functions

Most used PHP functions