class DateTimeZone extends DateTimeZone (View source)

Constants

DESCRIPTION_OFFSET

DESCRIPTION_OFFSET_FORMAT

DESCRIPTION_NAME

UTC_OFFSET_STRING_PATTERN

Methods

string
getAbbreviation()

No description

static DateTimeZone[]
listMatchingOffsetTimezones(DateTimeZone $timezone, integer $timezoneGroup = \DateTimeZone::ALL, string $countryCode = null)

Get all time zone with the same UTC offset

static DateTimeZone
createFromDescription(string|number|array $description)

Create a DateTimeZone from a various kind of time zone description.

static DateTimeZone
createFromOffset(string|integer $value, string|NULL $format = null)

No description

static string
getOffsetFormat(string $value)

No description

Details

string getAbbreviation()

Return Value

string Timezone abbreviation

static DateTimeZone[] listMatchingOffsetTimezones(DateTimeZone $timezone, integer $timezoneGroup = \DateTimeZone::ALL, string $countryCode = null)

Get all time zone with the same UTC offset

Parameters

DateTimeZone $timezone
integer $timezoneGroup Time zone group.
string $countryCode ISO 3166-1 compatible country code.

Return Value

DateTimeZone[]

See also

https://www.php.net/manual/en/datetimezone.listidentifiers.php

static DateTimeZone createFromDescription(string|number|array $description)

Create a DateTimeZone from a various kind of time zone description.

Parameters

string|number|array $description Time zone description. Could be

  • A numeric UTC offset
  • A time zone name
  • A time zone offset string (ex. +02:00)
  • An array describing the time zone

Return Value

DateTimeZone

Exceptions

InvalidArgumentException

static DateTimeZone createFromOffset(string|integer $value, string|NULL $format = null)

Parameters

string|integer $value Time zone offset representation
string|NULL $format Time zone offset string format

Return Value

DateTimeZone

static string getOffsetFormat(string $value)

Parameters

string $value

Return Value

string PHP date() format string

Exceptions

InvalidArgumentException