Posted 27 June 2006 - 08:45 PM
I want to convert that with php so I can print it out like this: June 23, 2006
I need to keep the format of the date in the table because it needs to be 2006-06-23 due to another script that uses the date in that format.
So how can i use PHP to pull the date out of the database and convert it to the longer format?
Posted 27 June 2006 - 08:51 PM
$oldDate = '2006-06-23'; $answer = date('F d, Y',strtotime(date('Y-m-d',$oldDate)));
so ur taking the old date, converting it to a unix timestamp, then reformatting it to how you want to see it.
FYI - it's easier just to start out with the Unix timestamp in the DB. =D
Posted 27 June 2006 - 09:17 PM
Posted 28 June 2006 - 06:10 AM
December 31, 1969
Posted 28 June 2006 - 06:30 AM
$oldDate = '2006-06-23'; $answer = date('F d, Y',strtotime($oldDate));
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users