PHP timezone_identifiers_list() Function
Definition
The timezone_identifiers_list() returns an indexed array containing all timezone identifiers.
Syntax
PHP timezone_identifiers_list() Function has the following syntax.
timezone_identifiers_list(timezoneClassConstant,country);
Parameter
Parameter | Is Required | Description |
---|---|---|
timezoneClassConstant | Optional. | DateTimeZone class constant |
country | Optional. | Two-letter ISO 3166-1 compatible country code |
Possible values for timezoneClassConstant
- 1 = AFRICA
- 2 = AMERICA
- 4 = ANTARCTICA
- 8 = ARCTIC
- 16 = ASIA
- 32 = ATLANTIC
- 64 = AUSTRALIA
- 128 = EUROPE
- 256 = INDIAN
- 512 = PACIFIC
- 1024 = UTC
- 2047 = ALL
- 4095 = ALL_WITH_BC
- 4096 = PER_COUNTRY
Return
PHP timezone_identifiers_list() Function returns an indexed array on success. FALSE on failure.
Example
Print all timezones in Africa
<?php
print_r(timezone_identifiers_list(1));
?>
The code above generates the following result.