DateTimeZone 类
(PHP 5 >= 5.2.0, PHP 7, PHP 8)
简介
时区表示。
类摘要
class DateTimeZone
{
/* 常量 */
/* 方法 */
public function getTransitions(int
$timestampBegin = PHP_INT_MIN, int $timestampEnd = 2147483647): array|falsepublic static function listIdentifiers(int
}$timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array预定义常量
DateTimeZone::AFRICA
int
非洲时区。
DateTimeZone::AMERICA
int
美洲时区。
DateTimeZone::ANTARCTICA
int
南极洲时区。
DateTimeZone::ARCTIC
int
北极时区。
DateTimeZone::ASIA
int
亚洲时区。
DateTimeZone::ATLANTIC
int
大西洋时区。
DateTimeZone::AUSTRALIA
int
澳洲时区。
DateTimeZone::EUROPE
int
欧洲时区。
DateTimeZone::INDIAN
int
印度洋(Indian)时区。
DateTimeZone::PACIFIC
int
太平洋时区。
DateTimeZone::UTC
int
UTC 时区。
DateTimeZone::ALL
int
所有时区。
DateTimeZone::ALL_WITH_BC
int
所有时区,包含向后兼容。
DateTimeZone::PER_COUNTRY
int
每个国家的时区。
更新日志
| 版本 | 说明 |
|---|---|
| 8.4.0 | 类常量现已类型化。 |
目录
- DateTimeZone::__construct — 创建新的DateTimeZone对象
- DateTimeZone::getLocation — 返回与时区相关的定位信息
- DateTimeZone::getName — 返回时区名称
- DateTimeZone::getOffset — 返回相对于 GMT 的时差
- DateTimeZone::getTransitions — Returns all transitions for the timezone
- DateTimeZone::listAbbreviations — 返回一个包含 dst (夏令时),时差和时区信息的关联数组。
- DateTimeZone::listIdentifiers — 返回包含了所有时区标识符的数字索引数组
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
