PHP 8.4.6 Released!

The DateTimeZone class

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

Introduction

Representation of time zone.

Class synopsis

class DateTimeZone {
/* Constants */
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;
/* Methods */
public __construct(string $timezone)
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
}

Predefined Constants

DateTimeZone::AFRICA int

Africa time zones.

DateTimeZone::AMERICA int

America time zones.

DateTimeZone::ANTARCTICA int

Antarctica time zones.

DateTimeZone::ARCTIC int

Arctic time zones.

DateTimeZone::ASIA int

Asia time zones.

DateTimeZone::ATLANTIC int

Atlantic time zones.

DateTimeZone::AUSTRALIA int

Australia time zones.

DateTimeZone::EUROPE int

Europe time zones.

DateTimeZone::INDIAN int

Indian time zones.

DateTimeZone::PACIFIC int

Pacific time zones.

DateTimeZone::UTC int

UTC time zones.

DateTimeZone::ALL int

All time zones.

DateTimeZone::ALL_WITH_BC int

All time zones including backwards compatible.

DateTimeZone::PER_COUNTRY int

Time zones per country.

Changelog

Version Description
8.4.0 The class constants are now typed.

Table of Contents

User Contributed Notes

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