PHP timezone_name_get() Function

Example

Returns the name of the time zone:

<?php
$tz=timezone_open("America/New_York");
echo timezone_name_get($tz);
?>

Run Example

Definition and Usage

timezone_name_get() returns the name of the time zone.

Syntax

timezone_name_get(object);
Parameter Description
object Required. Specifies a DateTimeZone object.

Technical Details

Return Value: Returns the name of the time zone from the time zone list.
PHP Version: 5.2+