Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法转换这个:
Tue Aug 28 13:59:01 +0000 2012
进入日期时间对象?
我需要用 DateTime 对象来区分上述值。
只需将其传递给 DateTime 构造函数...
$date = new DateTime('Tue Aug 28 13:59:01 +0000 2012'); echo $date->format('Y-m-d H:i:s');
$date = new DateTime($yourDate);
这将转换为标准 DateTime 对象
在此处查看 php 手册。示例 2 将说明这一点。