DateTimeZone
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程

DateTimeZone::listIdentifiers

(PHP 5 >= 5.3.0)

DateTimeZone::listIdentifiersReturns numerically index array with all timezone identifiers

说明

array DateTimeZone::listIdentifiers ([ int $what=DateTime::ALL [, string $country=NULL ]] )
array timezone_identifiers_list ([ int $what=DateTime::ALL [, string $country=NULL ]] )

参数

object

Procedural style only: A DateTime object returned by date_create()

what

One of DateTimeZone class constants, defaults to DateTimeZone::ALL.

country

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

返回值

Returns array on success or FALSE on failure.

范例

Example #1 A timezone_identifiers_list() example

<?php
$timezone_identifiers 
DateTimeZone::listIdentifiers();
for (
$i=0$i 5$i++) {
    echo 
"$timezone_identifiers[$i]\n";
}
?>

上例的输出类似于:

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmera

参见


DateTimeZone
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程