如何使用此格式设置php日期的格式

如何使用此格式设置php日期的格式,php,Php,我想用php将日期转换成以下格式 2014-12-09T18:30:00.000Z 这种时间格式叫什么 如何将任何日期格式化为这种格式 请建议,谢谢我想这就是你想要的: $date->format('Y-m-d\TH:i:s\Z'); 编辑: 时区 要指定时区,您可以在UTC时间中输入日期,方法是在日期后添加“Z”-如下所示: 2002-09-24Z 日期时间数据类型 dateTime数据类型用于指定日期和时间 日期时间以以下形式“YYYY-MM-DDThh:MM:ss”指定,其中:

我想用php将日期转换成以下格式

2014-12-09T18:30:00.000Z

这种时间格式叫什么

如何将任何日期格式化为这种格式


请建议,谢谢

我想这就是你想要的:

$date->format('Y-m-d\TH:i:s\Z');
编辑:

时区

要指定时区,您可以在UTC时间中输入日期,方法是在日期后添加“Z”-如下所示:

2002-09-24Z
日期时间数据类型

dateTime数据类型用于指定日期和时间

日期时间以以下形式“YYYY-MM-DDThh:MM:ss”指定,其中:


看一看@scrowler的副本或可能的副本我知道如何格式化日期,我想知道我们称之为什么格式?如何将任何日期转换成这种格式?请查看/和@machineaddict的文档谢谢您的帮助,我通过参考问题解决了它。这种时间戳叫什么?
YYYY indicates the year
MM indicates the month
DD indicates the day
T indicates the start of the required time section
hh indicates the hour
mm indicates the minute
ss indicates the second