PHP timezone_name_from_abbr() Function

Example

Returns the time zone name based on the time zone 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 time zone name based on the time zone abbreviation.

Syntax

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

Optional. Specifies the offset in seconds relative to GMT.

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

If not found, returns the first time zone with any offset.

isdst

Optional. Specifies the daylight saving time indicator.

  • -1 = Default. Whether to consider daylight saving time when searching for the time zone
  • 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 time zone name if successful, returns FALSE if failed.
PHP Version: 5.1.3+