phpretard Posted February 14, 2008 Share Posted February 14, 2008 The datbase id set to default like this 0000-00-00. I would like to display the date like this 02-14-08. The code below doesn't work (I am sure this is obvious to someone). $date= $row['date']; $date1=date_format($date, '%m %d %y'); echo $date1 ; Please help me... -Anthony Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted February 14, 2008 Share Posted February 14, 2008 SELECT DATE_FORMAT(date, '%m-%d-%y') AS formatted_date FROM table; See: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.