PHP timezone_name_get() Function
In this chapter you will learn:
- Definition for PHP timezone_name_get() Function
- Syntax for PHP timezone_name_get() Function
- Parameter for PHP timezone_name_get() Function
- Return value for PHP timezone_name_get() Function
- Example - Return the name of the timezone
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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP timezone_offset_get() Function
- Syntax for PHP timezone_offset_get() Function
- Parameter for PHP timezone_offset_get() Function
- Return value for PHP timezone_offset_get() Function
- Example - Return the timezone offset from GMT
Home » PHP Tutorial » PHP Date Functions