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
Release: 2016-06-06 20:40:55
Original
1287 people have browsed it

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

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

回复内容:

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

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

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

<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>
Copy after login

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

Related labels:
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