PHP timezone_transitions_get() Function

❮ PHP Date/Time Reference

Example

Return a transition for a timezone:

<?php
$timezone = new DateTimeZone("Europe/Paris");
// Procedural style
print_r(reset(timezone_transitions_get($timezone)));

echo "<br><br>"

// Object oriented style
print_r(reset($timezone->getTransitions()));
?>
Try it Yourself »

Definition and Usage

The timezone_transitions_get() returns all transitions for the timezone.


Syntax

The two functions below are equivalent and any of the functions can be used as shown in the example above.

Procedural style:

timezone_transitions_get(object, timestamp_start, timestamp_end)

Object oriented style:

DateTimeZone::getTransitions(timestamp_start, timestamp_end)

Parameter Values

Parameter Description
object Required (for procedural style). Specifies a DateTimeZone object
timestamp_start Optional. Begin timestamp
timestamp_end Optional. End timestamp


Technical Details

Return Value: A numerically indexed array containing associative array with all transitions on success. FALSE on failure
PHP Version: 5.2+
PHP Changelog: PHP 5.3: Added timestamp_begin and timestamp_end parameters

❮ PHP Date/Time Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.