Guest Posted July 12, 2007 Share Posted July 12, 2007 I am storing my time in a databse but i want to take it out and show it as a date like 7-12-2007 how can i convert the time() into the date? I dont care about hour minute second i just want the date. Quote Link to comment Share on other sites More sharing options...
Wildbug Posted July 12, 2007 Share Posted July 12, 2007 In MySQL, use DATE_FORMAT(col,"%m-%d-%Y") http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 12, 2007 Share Posted July 12, 2007 <?php $current = time(); //This could also be a timestamp from your database $time_new = date("m-d-Y", $current); echo $time_new; ?> 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.