Latest web development tutorials

PHP timezone_open () function

PHP Date / Time PHP Date / Time Reference Manual

Examples

DateTimeZone create a new object, and then returns the name of the time zone:

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

Running instance »

Definition and Usage

timezone_open () to create a new DateTimeZone object.

grammar

timezone_open( timezone);

参数 描述
timezone 必需。规定一个时区。

提示: 查看 PHP 中支持的所有时区列表

technical details

return value: DateTimeZone success, returns an object, then failed to return FALSE.
PHP version: 5.2+


PHP Date / Time PHP Date / Time Reference Manual