sonicboom sonicboom - 1 year ago 87
MySQL Question

Formatting date to human readable format

Lets say in my mysql database I have a timestamp

2013-09-30 01:16:06
and lets say this variable is

How can I output this to show more like
September 30th, 2013

Answer Source
$timestamp = "2013-09-30 01:16:06";
echo date("F jS, Y", strtotime($timestamp)); //September 30th, 2013

Note the use of S to get the english ordinal suffix for the day.
Since you're already using strtotime if you need a human readable data for the current time you can just use the keyword "now" as in strtotime("now")

Related sources

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download