Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

timezone_transitions_get()

Example

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()));
?>

Definition and Usage

The timezone_transitions_get() function returns all transitions for the specified timezone.

Syntax

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 Values

 

Parameter

Description

object

Required (for procedural style). Specifies a DateTimeZone object.

timestamp_start

Optional. Starting timestamp.

timestamp_end

Optional. Ending timestamp.

Technical Details

Return Value:

Returns a numerically indexed array of associative arrays with all transitions on success, or FALSE on failure.

PHP Version:

5.2+

PHP Changelog:

PHP 5.3: Introduced the timestamp_begin and timestamp_end parameters.