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

php获取 格林威治标准时间

WBOY
Release: 2016-06-06 20:13:22
Original
2495 people have browsed it

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

回复内容:

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

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

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

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

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

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

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

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template