Web | This Site

Learning PHP
Advanced PHP
PHP Function Reference
PHP Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM

| Home |  | References |  | Discussion Forums |  | About TP

# PHP Function timezone_transitions_get()

## Syntax

array timezone_transitions_get ( DateTimeZone $object ) array DateTimeZone::getTransitions ( void )

## Definition and Usage

These functions return all transitions for the timezone.

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

## Paramters

Parameter | Description
--- | ---
object | DateTimeZone object.

## Return Value

Returns numerically indexed array containing associative array with all transitions on success or FALSE on failure.

## Example

Following is the usage of this function:

    <?php
    $timezone = new DateTimeZone("CET");
    print_r(reset($timezone->getTransitions()));

    echo"------------------------------------------------\n";

    print_r( reset( timezone_transitions_get ($timezone) ) );
    ?>

This will produce following result:

    Array
    (
        [ts] => -1693706400
        [time] => 1916-04-30T22:00:00+0000
        [offset] => 7200
        [isdst] => 1
        [abbr] => CEST
    )
    ------------------------------------------------
    Array
    (
        [ts] => -1693706400
        [time] => 1916-04-30T22:00:00+0000
        [offset] => 7200
        [isdst] => 1
        [abbr] => CEST
    )

Advertisement

Online Image Processing

Indian Baby Names