Format date from database?

Normally the code is just:

echo date('F d, Y h:mA', strtotime('2009-10-14 19:00:00'));

Note that if strtotime() can’t figure out the date, it returns the time as 1/1/1970 00:00:00 GMT.

Leave a Comment