目录

PHP timezone_name_from_abbr() 函数

❮ PHP 日期/时间参考

示例

从缩写返回时区名称:

<?php
echo timezone_name_from_abbr("EST") . "<br>";
echo timezone_name_from_abbr("",7200,0);
?>
亲自试一试 »

定义和用法

timezone_name_from_abbr() 从缩写返回时区名称。


语法

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


技术细节

返回值: 成功时返回时区名称。失败时为 FALSE
PHP 版本: 5.1.3+

❮ PHP 日期/时间参考