Latest web development tutorials

PHP timezone_name_from_abbr () function

PHP Date / Time PHP Date / Time Reference Manual

Examples

Acronyms return to the time zone time zone name:

<?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 name of the time zone according to the time zone abbreviations.

grammar

timezone_name_from_abbr( abbr,gmtoffset,isdst);

参数 描述
abbr 必需。规定时区缩略语。
gmtoffset 可选。规定相对于 GMT 的以秒为单位的偏移量。默认为 -1,表示返回第一个被找到的匹配缩略语的时区。否则搜索精确的偏移量。如果没有找到,则返回任意偏移量的第一个时区。
isdst 可选。规定夏令时指示器。
  • -1 = 默认。搜索时是否考虑时区的夏令时
  • 1 = 表示 gmtoffset 是受夏令时影响的一个偏移量
  • 0 = 表示 gmtoffset 是不受夏令时影响的一个偏移量

technical details

return value: Returns time zone name on success, on failure returns FALSE.
PHP version: 5.1.3+


PHP Date / Time PHP Date / Time Reference Manual