PHP timezone_transitions_get() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
Date/Time

Definition

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.

PHP
$transitions = timezone_transitions_get($tz, $begin, $end);
CallWhat it does
timezone_transitions_get($tz)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

ParameterDescription
objectRequired. A DateTimeZone object, usually created with timezone_open() or new DateTimeZone().
timestampBeginOptional. The start of the range as a Unix timestamp. The default is PHP_INT_MIN, which means the beginning of the data.
timestampEndOptional. 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 ValueDescription
arrayA list of arrays with the keys ts (int), time (string), offset (int), isdst (bool) and abbr (string).
falseReturned 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.

PHP
<?php
$tz = new DateTimeZone('Europe/London');
$begin = strtotime('2026-01-01 00:00:00 UTC');
$end = strtotime('2026-12-31 00:00:00 UTC');

$transitions = timezone_transitions_get($tz, $begin, $end);

echo "Rows: ", count($transitions), PHP_EOL;
foreach ($transitions as $row) {
    echo $row['time'], ' ', $row['abbr'], ' ', $row['offset'], PHP_EOL;
}

How It Works

  1. strtotime() with UTC creates the begin and end timestamps for 2026.
  2. timezone_transitions_get() returns the rows inside that range.
  3. The first row shows London on GMT at the start of the year.
  4. On March 29 the clocks go forward to BST, and on October 25 they go back to GMT.

Example 2 — Zones Without Daylight Saving Time

Some zones do not change their rules. In that case only the first row (the state at the start) is returned.

PHP
<?php
$begin = strtotime('2026-01-01 00:00:00 UTC');
$end = strtotime('2026-12-31 00:00:00 UTC');

$kolkata = timezone_transitions_get(timezone_open('Asia/Kolkata'), $begin, $end);
$utc = timezone_transitions_get(timezone_open('UTC'), $begin, $end);

echo "Kolkata rows: ", count($kolkata), PHP_EOL;
echo "UTC rows: ", count($utc), PHP_EOL;
echo $kolkata[0]['abbr'], PHP_EOL;

How It Works

  1. The same timestamp range is used for both zones.
  2. India and UTC do not change their clocks during 2026.
  3. So each result has only the first row that describes the zone at the start.
  4. The abbreviation of the Kolkata zone is IST.

Example 3 — Finding Daylight Saving Changes in New York

Skip the first row with array_slice() so you see only the real changes, and print whether each one is daylight saving or standard time.

PHP
<?php
$tz = new DateTimeZone('America/New_York');
$begin = strtotime('2026-01-01 00:00:00 UTC');
$end = strtotime('2026-12-31 00:00:00 UTC');

$all = timezone_transitions_get($tz, $begin, $end);
$changes = array_slice($all, 1);

foreach ($changes as $row) {
    $kind = $row['isdst'] ? 'daylight saving' : 'standard';
    echo $row['time'], ' ', $row['abbr'], ' (', $kind, ')', PHP_EOL;
}

How It Works

  1. The full list contains the starting row and then the real changes.
  2. array_slice($all, 1) removes the first row.
  3. The isdst field is true when daylight saving time begins.
  4. Times are shown in UTC: clocks in New York change at 2:00 local time on March 8 and November 1.

Frequently Asked Questions

It returns a list of the moments when a time zone changes its offset or abbreviation, for example when daylight saving time starts or ends.
The first row describes the zone at the start timestamp you passed. The real changes start from the second row.
The zone has no changes in the time range you asked for. Zones like Asia/Kolkata and UTC do not use daylight saving time.
Yes. Without them, the function returns the full history of the zone, which can be hundreds of rows.
Yes. It is the procedural alias of the getTransitions() method.

Next: timezone_version_get()

timezone_version_get() returns the version of the time zone database that your PHP install.

timezone_version_get() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful