Home >Backend Development >PHP Tutorial >php获取 格林威治标准时间

php获取 格林威治标准时间

WBOY
WBOYOriginal
2016-06-06 20:13:222491browse

怎样获取格林威治标准时间

回复内容:

怎样获取格林威治标准时间

<code><?php $date = new DateTime('now', new DateTimeZone('UTC'));

// timestamp
echo $date->getTimestamp();

// format
echo $date->format('Y-m-d H:i:s');</code>

文档:
http://no2.php.net/manual/zh/class.datetime.php

<code>gmdate('Y-m-d H:i:s');</code>

具体看官网 http://php.net/manual/zh/function.gmdate...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn