PHP timezone_open() Function

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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions