← 返回列表

PHP timezone_open() 函数

PHP timezone_open() 函数 实例 创建一个新的 DateTimeZone 对象,然后返回时区的名称: <?php $tz=timezone_open("Europe/Paris"); echo timezone_name_get($tz); ?> 定义和用法 timezone_open() 创建一个新的 DateTimeZone 对象。 语法 timezone_open( _timezone);_ 参数 描述 _timezone_ 必需。规定一个时区。 **提示:** [查看 PHP 中支持的所有时区列表](php-ref-timezones.html) 技术细节 返回值: 成功则返回 DateTimeZone 对象,失败则返回 FALSE。 PHP 版本: 5.2+

PHP timezone_open() 函数


实例

创建一个新的 DateTimeZone 对象,然后返回时区的名称:

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

定义和用法

timezone_open() 创建一个新的 DateTimeZone 对象。

语法

timezone_open( _timezone);_
参数 描述
_timezone_ 必需。规定一个时区。 **提示:** [查看 PHP 中支持的所有时区列表](php-ref-timezones.html)

技术细节

返回值: 成功则返回 DateTimeZone 对象,失败则返回 FALSE。
PHP 版本: 5.2+

打开资源 ↗

交流与评论