Home >Backend Development >PHP Tutorial >日期 - PHP如何生成过期GMT时间 Mon,12 May 2001 00:20:00 GMT

日期 - PHP如何生成过期GMT时间 Mon,12 May 2001 00:20:00 GMT

WBOY
WBOYOriginal
2016-06-06 20:40:551288browse

PHP如何生成GMT时间,类似这样的日期(欧美人最常用的):

<code>Mon,12 May 2001 00:20:00 GMT
</code>

回复内容:

PHP如何生成GMT时间,类似这样的日期(欧美人最常用的):

<code>Mon,12 May 2001 00:20:00 GMT
</code>

<code><?php gmdate('D, d M Y H:i:s T');
</code></code>

<code>$time = new DateTime("2001-05-12 00:20:00", new DateTimeZone("GMT"));
echo $time->format("D, d M Y H:i:s T");
</code>

http://3v4l.org/07jJ8 其实我一直在好奇题主设置的时区的,因为2010年5月12日中国时间是星期六诶...

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