How can I convert 2016-12-20T18:36:14.000Z
to a readable date/time in PHP?
like Dec 20, 2016
.
$olddate = '2016-12-20T18:36:14.000Z';
echo date('M d,Y',strtotime($olddate));
Following will do the trick
$t = "2016-12-20T18:36:14.000Z";
echo date('M d,Y', strtotime($t));
Use the DateTime::format() like this:
<?php
echo date_create('2016-12-20T18:36:14.000Z')->format('M d, Y');
output:
~$ php test.php
Dec 20, 2016l