📜  php 将日期和时间转换为 iso 8601 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:45.292000             🧑  作者: Mango

代码示例1
//Object Oriented Method

$datetime = new DateTime('2010-12-30 23:21:46');

echo $datetime->format(DateTime::ATOM); // Updated ISO8601


//Procedural Method

echo date(DATE_ISO8601, strtotime('2010-12-30 23:21:46'));