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

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

WBOY
WBOYOriginal
2016-06-06 20:36:541161browse

<code>date(DATE_ATOM,time())
</code>

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

回复内容:

<code>date(DATE_ATOM,time())
</code>

为什么这样,我只能格式化出 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>
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