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_abbreviations_list()

## Syntax

array timezone_abbreviations_list ( void ); array DateTimeZone::listAbbreviations ( void );

## Definition and Usage

These functions return associative array containing dst, offset and the timezone name.

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

## Paramters

Parameter | Description
--- | ---
void | NA

## Return Value

Returns array on success or FALSE on failure.

## Example

Following is the usage of this function:

    <?php
    $timezone_abbreviations = timezone_abbreviations_list ();
    print_r($timezone_abbreviations["acst"]);
    echo "----------------------------------------------\n";

    # Using second function.
    $timezone_abbreviations = DateTimeZone::listAbbreviations();
    print_r($timezone_abbreviations["acst"]);
    ?>

This will produce following result:

    Array
    (
        [0] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => America/Porto_Acre
            )

        [1] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => America/Eirunepe
            )

        [2] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => America/Rio_Branco
            )

        [3] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => Brazil/Acre
            )

    )
    ------------------------------------------------------
    Array
    (
        [0] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => America/Porto_Acre
            )

        [1] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => America/Eirunepe
            )

        [2] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => America/Rio_Branco
            )

        [3] => Array
            (
                [dst] => 1
                [offset] => -14400
                [timezone_id] => Brazil/Acre
            )

    )

Advertisement

Online Image Processing

Indian Baby Names