The date_timezone_get() function returns the time zone of the given DateTime object.
PHP date_timezone_get() Function has the following syntax.
date_timezone_get(object);
PHP date_timezone_get() Function has the following parameters.
PHP date_timezone_get() Function returns a DateTimeZone object on success. FALSE on failure.
Return the timezone of the given DateTime object:
<?php
$date=date_create(null,timezone_open("Europe/Paris"));
$tz=date_timezone_get($date);
echo timezone_name_get($tz);
?>
The code above generates the following result.