PHP timezone_name_get() Function

PHP timezone_offset_get() Function
PHP chr() Function

In this article, you will learn how to get the name of the timezone. You can either know
about the name of the timezone of your current location or region just by passing the
timezone object to this function or some other timezone object.

What is the syntax of the timezone_name_get() function in PHP?

timezone_name_get(object)
ParameterDescription
objectDatetime Object – Required
PHP timezone_name_get() method

Example of the timezone_name_get() function

Example 1. In this example, we create a new timezone object using the timezone_open object and then the timezone name using the timezone_name_get() function.

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

PHP timezone_offset_get() Function
PHP chr() Function
en English
X
Scroll to Top