Monday, 26 August 2013

PHP Function timezone_name_from_abbr()

Syntax

timezone_name_from_abbr( $abbr [, $gmtOffset [, $is_dst]] );

Definition and Usage

This function returns the timezone name from abbrevation.

Paramters

ParameterDescription
abbrRequired. Time zone abbreviation.
gmtOffsetOptional. Offset from GMT in seconds.
is_dstOptional. Daylight saving time indicator.

Return Value

Returns time zone name on success or FALSE on failure.

Example

Following is the usage of this function:
<?php
echo timezone_name_from_abbr("CET") . "\n";
echo timezone_name_from_abbr("", 3600, 0) . "\n";
?>
This will produce following result:
Europe/Berlin
Europe/Paris

No comments:

Post a Comment