class DateTimeZone (View source)

Representation of time zone

Constants

AFRICA

AMERICA

ANTARCTICA

ARCTIC

ASIA

ATLANTIC

AUSTRALIA

EUROPE

INDIAN

PACIFIC

UTC

ALL

ALL_WITH_BC

PER_COUNTRY

Methods

__construct(string $timezone)

No description

string
getName()

Returns the name of the timezone

array|false
getLocation()

Returns location information for a timezone

int
getOffset(DateTimeInterface $datetime)

Returns the timezone offset from GMT

array|false
getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX)

Returns all transitions for the timezone

static array
listAbbreviations()

Returns associative array containing dst, offset and the timezone name

static array
listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, string $countryCode = null)

Returns a numerically indexed array with all timezone identifiers

void
__wakeup()

No description

static 
__set_state($an_array)

No description

array
__serialize()

No description

void
__unserialize(array $data)

No description

Details

__construct(string $timezone)

No description

Parameters

string $timezone

Exceptions

DateInvalidTimeZoneException

string getName()

Returns the name of the timezone

Return Value

string

array|false getLocation()

Returns location information for a timezone

Return Value

array|false

int getOffset(DateTimeInterface $datetime)

Returns the timezone offset from GMT

Parameters

DateTimeInterface $datetime

Return Value

int

array|false getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX)

Returns all transitions for the timezone

Parameters

int $timestampBegin
int $timestampEnd

Return Value

array|false

static array listAbbreviations()

Returns associative array containing dst, offset and the timezone name

Return Value

array

static array listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, string $countryCode = null)

Returns a numerically indexed array with all timezone identifiers

Parameters

int $timezoneGroup
string $countryCode

Return Value

array

Returns the array of timezone identifiers, or FALSE on failure. Since PHP8, always returns array.

void __wakeup()

No description

Return Value

void

static __set_state($an_array)

No description

Parameters

$an_array

array __serialize()

No description

Return Value

array

void __unserialize(array $data)

No description

Parameters

array $data

Return Value

void