PHP timezone_open() Function
In this chapter you will learn:
- Definition for PHP timezone_open() Function
- Syntax for PHP timezone_open() Function
- Parameter for PHP timezone_open() Function
- Return value for PHP timezone_open() Function
- Example - Create a new DateTimeZone object, then return the name of the timezone
Definition
The timezone_open() creates a new DateTimeZone object.
Syntax
PHP timezone_open() Function has the following syntax.
timezone_open(timezone)
Parameter
PHP timezone_open() Function has the following parameter.
- timezone - Required. A timezone
Return
PHP timezone_open() Function returns the DateTimeZone object on success. FALSE on failure.
Example
Create a new DateTimeZone object, then 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_version_get() Function
- Syntax for PHP timezone_version_get() Function
- Return value for PHP timezone_version_get() Function
- Example - Return the version of the timezone db
Home » PHP Tutorial » PHP Date Functions