Since: 5.5

class IntlTimeZone (View source)

Constants

DISPLAY_SHORT

DISPLAY_LONG

DISPLAY_SHORT_GENERIC

DISPLAY_LONG_GENERIC

DISPLAY_SHORT_GMT

DISPLAY_LONG_GMT

DISPLAY_SHORT_COMMONLY_USED

DISPLAY_GENERIC_LOCATION

TYPE_ANY

TYPE_CANONICAL

TYPE_CANONICAL_LOCATION

Methods

static int|false
countEquivalentIDs(string $timezoneId)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the number of IDs in the equivalency group that includes the given ID

static IntlTimeZone
createDefault()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a new copy of the default timezone for this host

static IntlIterator|false
createEnumeration(mixed $countryOrRawOffset)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get an enumeration over time zone IDs associated with the given country or offset

static IntlTimeZone|null
createTimeZone(string $timezoneId)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a timezone object for the given ID

static IntlIterator|false
createTimeZoneIDEnumeration(int $type, string|null $region = null, int $rawOffset = null)

(PHP 5 >=5.5.0)
Get an enumeration over system time zone IDs with the given filter conditions

static IntlTimeZone|null
fromDateTimeZone(DateTimeZone $timezone)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a timezone object from DateTimeZone

static string|false
getCanonicalID(string $timezoneId, bool $isSystemId)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the canonical system timezone ID or the normalized custom time zone ID for the given time zone ID

string|false
getDisplayName(bool $dst = false, int $style = 2, string $locale)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get a name of this time zone suitable for presentation to the user

int
getDSTSavings()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the amount of time to be added to local standard time to get local wall clock time

static string|false
getEquivalentID(string $timezoneId, int $offset)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get an ID in the equivalency group that includes the given ID

int|false
getErrorCode()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error code on the object

string|false
getErrorMessage()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error message on the object

static IntlTimeZone
getGMT()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create GMT (UTC) timezone

string|false
getID()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get timezone ID

bool
getOffset(float $timestamp, bool $local, int $rawOffset, int $dstOffset)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the time zone raw and GMT offset for the given moment in time

int
getRawOffset()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the raw GMT offset (before taking daylight savings time into account

static string|false
getRegion(string $timezoneId)

(PHP 5 >=5.5.0)
Get the region code associated with the given system time zone ID

static string|false
getTZDataVersion()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the timezone data version currently used by ICU

static IntlTimeZone
getUnknown()

(PHP 5 >=5.5.0)
Get the "unknown" time zone

static string|false
getWindowsID(string $timezoneId)

(PHP 7 >=7.1.0)
Translates a system timezone (e.g. "America/Los_Angeles") into a Windows timezone (e.g. "Pacific Standard Time").

static string|false
getIDForWindowsID(string $timezoneId, string|null $region = null)

No description

bool
hasSameRules(IntlTimeZone $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Check if this zone has the same rules and offset as another zone

DateTimeZone|false
toDateTimeZone()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Convert to DateTimeZone object

bool
useDaylightTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Check if this time zone uses daylight savings time

static string|false
getIanaID(string $timezoneId)

No description

Details

static int|false countEquivalentIDs(string $timezoneId)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the number of IDs in the equivalency group that includes the given ID

Parameters

string $timezoneId

Return Value

int|false

number of IDs or FALSE on failure

static IntlTimeZone createDefault()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a new copy of the default timezone for this host

Return Value

IntlTimeZone

static IntlIterator|false createEnumeration(mixed $countryOrRawOffset)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get an enumeration over time zone IDs associated with the given country or offset

Parameters

mixed $countryOrRawOffset [optional]

Return Value

IntlIterator|false

an iterator or FALSE on failure

static IntlTimeZone|null createTimeZone(string $timezoneId)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a timezone object for the given ID

Parameters

string $timezoneId

Return Value

IntlTimeZone|null

a timezone object or NULL on failure

static IntlIterator|false createTimeZoneIDEnumeration(int $type, string|null $region = null, int $rawOffset = null)

(PHP 5 >=5.5.0)
Get an enumeration over system time zone IDs with the given filter conditions

Parameters

int $type
string|null $region [optional]
int $rawOffset [optional]

Return Value

IntlIterator|false

an iterator or FALSE on failure

static IntlTimeZone|null fromDateTimeZone(DateTimeZone $timezone)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create a timezone object from DateTimeZone

Parameters

DateTimeZone $timezone

Return Value

IntlTimeZone|null

a timezone object or NULL on failure

static string|false getCanonicalID(string $timezoneId, bool $isSystemId)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the canonical system timezone ID or the normalized custom time zone ID for the given time zone ID

Parameters

string $timezoneId
bool $isSystemId [optional]

Return Value

string|false

the timezone ID or FALSE on failure

string|false getDisplayName(bool $dst = false, int $style = 2, string $locale)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get a name of this time zone suitable for presentation to the user

Parameters

bool $dst [optional]
int $style [optional]
string $locale [optional]

Return Value

string|false

the timezone name or FALSE on failure

int getDSTSavings()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the amount of time to be added to local standard time to get local wall clock time

Return Value

int

static string|false getEquivalentID(string $timezoneId, int $offset)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get an ID in the equivalency group that includes the given ID

Parameters

string $timezoneId
int $offset

Return Value

string|false

the time zone ID or FALSE on failure

int|false getErrorCode()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error code on the object

Return Value

int|false

string|false getErrorMessage()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get last error message on the object

Return Value

string|false

static IntlTimeZone getGMT()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Create GMT (UTC) timezone

Return Value

IntlTimeZone

string|false getID()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get timezone ID

Return Value

string|false

bool getOffset(float $timestamp, bool $local, int $rawOffset, int $dstOffset)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the time zone raw and GMT offset for the given moment in time

Parameters

float $timestamp

moment in time for which to return offsets, in units of milliseconds from January 1, 1970 0:00 GMT, either GMT time or local wall time, depending on `local'.

bool $local

if true, `date' is local wall time; otherwise it is in GMT time.

int $rawOffset

output parameter to receive the raw offset, that is, the offset not including DST adjustments

int $dstOffset

output parameter to receive the DST offset, that is, the offset to be added to `rawOffset' to obtain the total offset between local and GMT time. If DST is not in effect, this value is zero; otherwise it is a positive value, typically one hour.

Return Value

bool

boolean indication of success

int getRawOffset()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the raw GMT offset (before taking daylight savings time into account

Return Value

int

static string|false getRegion(string $timezoneId)

(PHP 5 >=5.5.0)
Get the region code associated with the given system time zone ID

Parameters

string $timezoneId

Return Value

string|false

region or FALSE on failure

static string|false getTZDataVersion()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Get the timezone data version currently used by ICU

Return Value

string|false

static IntlTimeZone getUnknown()

(PHP 5 >=5.5.0)
Get the "unknown" time zone

Return Value

IntlTimeZone

static string|false getWindowsID(string $timezoneId)

Since: 7.1

(PHP 7 >=7.1.0)
Translates a system timezone (e.g. "America/Los_Angeles") into a Windows timezone (e.g. "Pacific Standard Time").

Parameters

string $timezoneId

Return Value

string|false

the Windows timezone or FALSE on failure

static string|false getIDForWindowsID(string $timezoneId, string|null $region = null)

Since: 7.1

No description

Parameters

string $timezoneId
string|null $region

Return Value

string|false

the Windows timezone or FALSE on failure

bool hasSameRules(IntlTimeZone $other)

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Check if this zone has the same rules and offset as another zone

Parameters

IntlTimeZone $other

Return Value

bool

DateTimeZone|false toDateTimeZone()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Convert to DateTimeZone object

Return Value

DateTimeZone|false

the DateTimeZone object or FALSE on failure

bool useDaylightTime()

(PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
Check if this time zone uses daylight savings time

Return Value

bool

static string|false getIanaID(string $timezoneId)

Since: 8.4

No description

Parameters

string $timezoneId

Return Value

string|false