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

ParameterIs RequiredDescription
timezoneClassConstantOptional.DateTimeZone class constant
countryOptional.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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions