-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
  • 663
  • 1
  • 6
  • 20

1 Answers1

1

Use date and strtotime:

$date = "2013-08-12 00:00";
$newDate = date('jS M Y', strtotime($date));
scrowler
  • 24,273
  • 9
  • 60
  • 92
The Maniac
  • 2,628
  • 3
  • 19
  • 29