-1

Evening all I always struggle with moving dates between one format and another. This is probably really simple but I am struggling to find the answer on the forums.

I have this date

$date = "2013-08-12 00:00";

And I want to echo it out like this

12th Aug 2013

Can someone help please

Barry Connolly
  • 653
  • 1
  • 6
  • 18

1 Answers1

1

Use date and strtotime:

$date = "2013-08-12 00:00";
$newDate = date('jS M Y', strtotime($date));
scrowler
  • 23,965
  • 9
  • 60
  • 90
The Maniac
  • 2,619
  • 3
  • 18
  • 29