【发布时间】:2017-06-10 09:09:36
【问题描述】:
我想要一个 php 中的函数,它将以下列格式返回日期
2017-01-25T08:55:40.000Z
我试过了
$obj->format(DateTime::ATOM); // output-> 2017-01-25T00:00:00+0100
$obj->format(DateTime::ISO8601); // output-> 2017-01-25T00:00:00+0100
我在 PHP 中没有得到任何解决方案 - 我可以使用 moment.js 在 javascript 中获得这种格式,但在 PHP 中没有。
【问题讨论】:
-
你的
$obj是什么班级?