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.
我有一个需要在 PHP 中复制的日期。我只想知道是否有某种短代码。
2013-05-09T15:23:59.802Z
它是ISO 8601。在 PHP 中,您可以使用:
echo date('c'); // as of PHP 5
看date()
date()
这一个班轮实现了您的要求。
echo date_format(date_create("@".$unix_timestamp, timezone_open('UTC')), 'Y-m-d\TH:i:s.000\Z');
输出:
2013-05-09T15:23:59.000Z