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);
?>

Running instance

Definition and usage

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

Syntax

timezone_name_from_abbr(abbr,gmtoffset,isdst);
Parameter Description
abbr Required. Specify the timezone abbreviation.
gmtoffset

Optional. Specify 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, it returns the first timezone with any offset.

isdst

Optional. Specify the daylight saving time indicator.

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

Technical details

Return value: If successful, it returns the timezone name, and if it fails, it returns FALSE.
PHP version: 5.1.3+