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

run instance

definition and usage

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

grammar

timezone_name_from_abbr(descriptiongmtoffsetisdst,
); parameter
description required. Define the timezone abbreviation.
gmtoffset

optional. Define the offset in seconds relative to GMT.

default is -1, which means returning the first matching timezone abbreviation found. Otherwise, search for an exact offset.

找不到时,则返回第一个匹配的偏移量的时区。

isdst

optional. Define daylight saving time indicator.

  • -1 = default. Whether to consider daylight saving time in the timezone search
  • 1 = represents gmtoffset 여름 시간대 조정에 영향을 받는 오차 값입니다.
  • 0 = 表示 gmtoffset 여름 시간대 조정에 영향을 받지 않는 오차 값입니다.

기술 세부 사항

반환 값: 성공하면 시간대 이름을 반환하고, 실패하면 FALSE를 반환합니다.
PHP 버전: 5.1.3+