Computer >> Computer tutorials >  >> Programming >> PHP

timezone_name_from_abbr() function in PHP


The timezone_name_from_abbr() function returns the timezone name from abbreviation.

Syntax

timezone_name_from_abbr(abbr, gmtOffset, is_dst)

Parameters

  • abbr  − Time zone abbreviation.

  • gmtoffset  − Offset from GMT in seconds.

  • is_dst  − Daylight saving time indicator.

Return

The timezone_name_from_abbr() function returns the timezone name from abbreviation.

Example

The following is an example −

<?php
   echo timezone_name_from_abbr("CET") . "<br />";
?>

Output

Europe/Berlin

Example

Let us see another example −

<?php
   echo timezone_name_from_abbr("EST") . "<br>";
?>

Output

America/New_York