PHP timezone_identifiers_list() function

Example

Output all time zones in Asia:

<?php
print_r(timezone_identifiers_list(16));
?>

Running instance

Definition and usage

timezone_identifiers_list() returns an indexed array containing all timezone identifiers.

Syntax

timezone_identifiers_list(what,country);
Parameters Description
what

Optional. Specify DateTimeZone class constants

  • 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
country Optional. Specify a two-letter ISO 3166-1 compatible country code.

Technical details

Return value: Returns an array of numbers if successful, returns FALSE if failed.
PHP version: 5.2+
Update log: PHP 5.3: Optional what and country Parameters.