Home > Backend Development > PHP Tutorial > date - 关于php中时间格式化问题

date - 关于php中时间格式化问题

WBOY
Release: 2016-06-06 20:36:54
Original
1208 people have browsed it

<code>date(DATE_ATOM,time())
</code>
Copy after login
Copy after login

为什么这样,我只能格式化出 2015-03-24 16:34 的格式呢...非常奇怪。
正常来说应该是2015-03-24T16:34+08:00 我设置了RPC时区

回复内容:

<code>date(DATE_ATOM,time())
</code>
Copy after login
Copy after login

为什么这样,我只能格式化出 2015-03-24 16:34 的格式呢...非常奇怪。
正常来说应该是2015-03-24T16:34+08:00 我设置了RPC时区

可以使用echo DATE_ATOM; 确认时间格式是否正确。
如果错误可以使用以下代码

<code>    // DATE_ATOM = "Y-m-d\TH:i:sP"
    echo date("Y-m-d\TH:i:sP",time());
</code>
Copy after login
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