Retrieve the transition information 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())); ?> |
The timezone_transitions_get() function returns all transitions for the specified timezone.
The two functions below are interchangeable; either can be used, as demonstrated in the example above.
Procedural style:
| timezone_transitions_get(object, timestamp_start, timestamp_end) |
Object oriented style:
| DateTimeZone::getTransitions(timestamp_start, timestamp_end) |
|
Parameter |
Description |
|
object |
Required (for procedural style). Specifies a |
|
timestamp_start |
Optional. Starting timestamp. |
|
timestamp_end |
Optional. Ending timestamp. |
|
Return Value: |
Returns a numerically indexed array of associative arrays with all transitions on success, or |
|
PHP Version: |
5.2+ |
|
PHP Changelog: |
PHP 5.3: Introduced the timestamp_begin and timestamp_end parameters. |