人类可读UTC日期时间
问题描述:
我有这种格式的日期时间:人类可读UTC日期时间
2017-04-01T17:35:00.000Z
哪能用PHP格式化,并在外观更好看变换呢?
我试着用:
date_format('2017-04-01T17:35:00.000Z',"F j, Y, g:i a");
,并返回我一个假布尔
答
<?php
$timestamp= strtotime("2017-04-01T17:35:00.000Z");
echo date("F j, Y, g:i a",$timestamp);
输出:
April 1, 2017, 5:35 pm
+0
我的结果是2017年4月1日下午7:35。为什么比你的两个小时晚? –
+0
@StefanoMaglione'17:35:00'是'05:35 PM' –
w ^帽子是否作为输出?一个错误?为什么不是“成功”? – wallyk
它返回一个虚假 –
可能的重复[如何将ISO8601转换为日期格式在PHP](http://stackoverflow.com/questions/22376415/how-to-convert-iso8601-to-date-format-in- php) – SunriseM