DateTimeZone 类

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

简介

时区表示。

类摘要

class DateTimeZone {
/* 常量 */
public const int AFRICA;
public const int AMERICA;
public const int ANTARCTICA;
public const int ARCTIC;
public const int ASIA;
public const int ATLANTIC;
public const int AUSTRALIA;
public const int EUROPE;
public const int INDIAN;
public const int PACIFIC;
public const int UTC;
public const int ALL;
public const int ALL_WITH_BC;
public const int PER_COUNTRY;
/* 方法 */
public __construct(string $timezone)
public getLocation(): array|false
public getName(): string
public getOffset(DateTimeInterface $datetime): int
public getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false
public static listAbbreviations(): array
public static listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array
}

预定义常量

DateTimeZone::AFRICA

非洲时区。

DateTimeZone::AMERICA

美洲时区。

DateTimeZone::ANTARCTICA

南极洲时区。

DateTimeZone::ARCTIC

北极时区。

DateTimeZone::ASIA

亚洲时区。

DateTimeZone::ATLANTIC

大西洋时区。

DateTimeZone::AUSTRALIA

澳洲时区。

DateTimeZone::EUROPE

欧洲时区。

DateTimeZone::INDIAN

印度洋(Indian)时区。

DateTimeZone::PACIFIC

太平洋时区。

DateTimeZone::UTC

UTC 时区。

DateTimeZone::ALL

所有时区。

DateTimeZone::ALL_WITH_BC

所有时区,包含向后兼容。

DateTimeZone::PER_COUNTRY

每个国家的时区。

目录

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top