timezone_transitions_get()

timezone_transitions_get() — Alias of DateTimeZone::getTransitions().

Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.2.0, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

timezone_transitions_get() is an alias of DateTimeZone::getTransitions(): same parameters, same return value.

Signature

timezone_transitions_get(DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = 2147483647): array|false

Parameters

ParameterTypeWhat it takes
$objectDateTimeZoneProcedural style only: A DateTimeZone object returned by timezone_open()
$timestampBeginintBegin timestamp.
$timestampEndintEnd timestamp.

Return value

Returns a numerically indexed array of transition arrays on success, or false on failure. DateTimeZone objects wrapping type 1 (UTC offsets) and type 2 (abbreviations) do not contain any transitions, and calling this method on them will return false. If timestampBegin is given, the first entry in the returned array will contain a transition element at the time of timestampBegin. Transition Array Structure Key Type Description ts int Unix timestamp time string DateTimeInterface::ISO8601_EXPANDED (PHP 8.2 and later), or DateTimeInterface::ISO8601 (PHP 8.1 and lower) time string offset int Offset to UTC in seconds isdst bool Whether daylight saving time is active abbr string Timezone ...

Example

A runnable snippet:

$timezone = new DateTimeZone("Europe/London"); $transitions = $timezone->getTransitions(); print_r(array_slice($transitions, 0, 3));

Output:

Array ( [0] => Array ( [ts] => -2147483648 [time] => 1901-12-13T20:45:52+00:00 [offset] => -75 [isdst] => [abbr] => LMT ) [1] => Array ( [ts] => 442304971 [time] => 1847-12-01T00:01:15+00:00 [offset] => 0 [isdst] => [abbr] => GMT ) [2] => Array ( [ts] => -1691964000 [time] => 1916-05-21T02:00:00+00:00 [offset] => 3600 [isdst] => 1 [abbr] => BST ) )

All PHP 8.5 built-in functions

Reference card built from the PHP manual page timezone_transitions_get() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.