PHP date_timezone_get() 函数

PHP 教程 · 2019-01-24 05:59:21

实例

返回给定 DateTime 对象的时区:

<?php
$date=date_create(null,timezone_open("Europe/Paris"));
$tz=date_timezone_get($date);
echo timezone_name_get($tz);
?>

定义和用法

date_timezone_get() 函数返回给定 DateTime 对象的时区。

语法

date_timezone_get(object);

参数 描述
object 必需。规定一个由 date_create() 返回的 DateTime 对象。

技术细节

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

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Hacking

Hacking

Jon Erickson / No Starch Press / 2008-2-4 / USD 49.95

While other books merely show how to run existing exploits, Hacking: The Art of Exploitation broke ground as the first book to explain how hacking and software exploits work and how readers could deve......一起来看看 《Hacking》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器