Jump to content

Formatting output date


johnrb87

Recommended Posts

You swap the month with days like so

list($month, $day, $year) = explode('-', $date);
$new_date = "$day-$month-$year";

print $new_date;

 

Alternatively your can format the date to 24th March 2010 using this

$new_date = date('jS F Y', strtotime($date));
print $new_date;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.