phpmysqldatetimestamp

convert mysql timestamp into actual date and time?


I have dates stored in a mysql table, they are set to store as CURRENT TIMESTAMP in each row and are stored as follows:

2010-05-29 01:17:35

but what i am trying to do is somehow use PHP to be able to seperate everything and create a date more like:

May 29 2010 1:17 AM

can anyone at least direct me in the right path that i should take. any help is greatly appreciated!


Solution

  • echo date('M j Y g:i A', strtotime('2010-05-29 01:17:35'));
    

    http://php.net/manual/en/function.date.php