1

How can I convert 2016-12-20T18:36:14.000Z to a readable date/time in PHP?

like Dec 20, 2016.

LF00
  • 27,015
  • 29
  • 156
  • 295

4 Answers4

2
$olddate = '2016-12-20T18:36:14.000Z';
echo date('M d,Y',strtotime($olddate));
1

Try this:

date('mdY') == date('mdY', strtotime($timestamp))
Md. Abutaleb
  • 1,590
  • 1
  • 14
  • 24
1

Following will do the trick

$t = "2016-12-20T18:36:14.000Z";
echo date('M d,Y', strtotime($t));
reza
  • 1,507
  • 2
  • 12
  • 17
1

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
LF00
  • 27,015
  • 29
  • 156
  • 295