In PHP, timezone_transitions_get() returns the moments when a time zone changes its rules, such as when daylight saving time starts or ends.
Each transition is an array with the timestamp, a readable time, the new offset, a daylight saving flag and the abbreviation. You can limit the result to a range of timestamps. It is the procedural version of DateTimeZone::getTransitions().
Syntax
Call timezone_transitions_get() with the values you need. Start with this line.
Returns every known transition for the zone. The list can be very long.
timezone_transitions_get($tz, $begin, $end)
Returns only the transitions between two timestamps.
$tz->getTransitions($begin, $end)
The object-oriented version that returns the same array.
Always pass a start and an end timestamp, otherwise the list covers the whole history of the zone. The first element of the result describes the zone at the start timestamp, and the real transitions follow it.
Library declarations
PHP
timezone_transitions_get(DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false
Parameters
Parameter
Description
object
Required. A DateTimeZone object, usually created with timezone_open() or new DateTimeZone().
timestampBegin
Optional. The start of the range as a Unix timestamp. The default is PHP_INT_MIN, which means the beginning of the data.
timestampEnd
Optional. The end of the range as a Unix timestamp. The default is PHP_INT_MAX, which means the end of the data.
Return Value
Return Value
Description
array
A list of arrays with the keys ts (int), time (string), offset (int), isdst (bool) and abbr (string).
false
Returned when the transitions cannot be read, for example for a zone created from a plain offset.
PHP Examples
Example 1 — Transitions of London in 2026
Ask for the changes between the start and the end of 2026. The first row is the state at the start, followed by the two daylight saving changes.