Latest web development tutorials
 

PHP timezone_name_from_abbr() Function

< PHP Date/Time Reference

Example

Return the timezone name from 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() returns the timezone name from abbreviation.


Syntax

timezone_name_from_abbr(abbr,gmtoffset,isdst);

Parameter Description
abbr Required. Specifies the timezone abbreviation
gmtoffset Optional. Specifies the offset from GMT in seconds. Default is -1, which means that first found timezone corresponding to abbr is returned. Otherwise exact offset is searched. If not found, the first timezone with any offset is returned
isdst Optional. Specifies daylight saving time indicator.
  • -1 = Default. Whether the timezone has daylight saving or not is not taken into consideration when searching
  •  1 = Means that the gmtoffset is an offset with daylight saving in effect
  • 0 = Means that the gmtoffset is an offset without daylight saving in effect

Technical Details

Return Value: Returns the timezone name on success. FALSE on failure
PHP Version: 5.1.3+

< PHP Date/Time Reference