(PHP 5 >= 5.2.0, PHP 7, PHP 8)
Introduction
Representation of time zone.
Class synopsis
class DateTimeZone {
/* Constants */
public const int ANTARCTICA;
public const int ALL_WITH_BC;
public const int PER_COUNTRY;
/* Methods */
public function __construct(string $timezone)
public function getLocation(): array|false
public function getOffset(DateTimeInterface $datetime): int
public function getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = 2147483647): array|false
public static function listAbbreviations(): array
public static function listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array
}
Predefined Constants
-
DateTimeZone::AFRICAint -
Africa time zones.
-
DateTimeZone::AMERICAint -
America time zones.
-
DateTimeZone::ANTARCTICAint -
Antarctica time zones.
-
DateTimeZone::ARCTICint -
Arctic time zones.
-
DateTimeZone::ASIAint -
Asia time zones.
-
DateTimeZone::ATLANTICint -
Atlantic time zones.
-
DateTimeZone::AUSTRALIAint -
Australia time zones.
-
DateTimeZone::EUROPEint -
Europe time zones.
-
DateTimeZone::INDIANint -
Indian time zones.
-
DateTimeZone::PACIFICint -
Pacific time zones.
-
DateTimeZone::UTCint -
UTC time zones.
-
DateTimeZone::ALLint -
All time zones.
-
DateTimeZone::ALL_WITH_BCint -
All time zones including backwards compatible.
-
DateTimeZone::PER_COUNTRYint -
Time zones per country.
Changelog
| Version | Description |
|---|---|
| 8.4.0 | The class constants are now typed. |