PHP timezone_name_from_abbr() Function

Example

Returns the timezone name based on the timezone abbreviation:

<?php
echo timezone_name_from_abbr("EST") . "<br>";
echo timezone_name_from_abbr("",7200,0);
?>

Run Example

Definition and Usage

The timezone_name_from_abbr() function returns the timezone name based on the timezone abbreviation.

Syntax

timezone_name_from_abbr(abbr,gmtoffset,isdst);
Parameters Description
abbr Required. Specifies the timezone abbreviation.
gmtoffset

Optional. Specifies the offset in seconds relative to GMT.

Default is -1, indicating that the first matching timezone abbreviation found is returned. Otherwise, search for an exact offset.

If not found, returns the first timezone with any offset.

isdst

Optional. Specifies the daylight saving time indicator.

  • -1 = Default. Whether to consider daylight saving time of the timezone when searching.
  • 1 = Indicates gmtoffset Is an offset that is affected by daylight saving time.
  • 0 = Indicates gmtoffset Is an offset that is not affected by daylight saving time.

Technical Details

Return Value: Returns the timezone name if successful, FALSE otherwise.
PHP Version: 5.1.3+