PHP Tutorial - PHP timezone_name_get() Function






Definition

The timezone_name_get() returns the name of the timezone.

Syntax

PHP timezone_name_get() Function has the following syntax.

timezone_name_get(object)

Parameter

PHP timezone_name_get() Function has the following parameter

  • object - Required. DateTimeZone object

Return

PHP timezone_name_get() Function returns a timezone name from the list of timezones.

Example

Return the name of the timezone:


<?php
    $tz=timezone_open("Europe/Paris");
    echo timezone_name_get($tz);
?>

The code above generates the following result.