1

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

like Dec 20, 2016.

LF00
  • 24,667
  • 25
  • 136
  • 263

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. Abu Taleb
  • 1,556
  • 1
  • 13
  • 23
1

Following will do the trick

$t = "2016-12-20T18:36:14.000Z";
echo date('M d,Y', strtotime($t));
reza
  • 1,489
  • 2
  • 11
  • 16
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
  • 24,667
  • 25
  • 136
  • 263