Page 1 of 1

mysql covert time

Posted: Tue Jan 26, 2010 2:53 pm
by bkchf123
I have this
  • date_added: 2010-01-26 14:14:23
    date_updated: 2010-01-26 14:23:38
I want this
  • date_added: 1-26-2010 4:14(am or pm)
    date_updated: 1-26-2010 4:23(am or pm)
here is the code

Code: Select all

 
<?php echo($row_WADAspecials['date_added']); ?>
<?php echo($row_WADAspecials['date_updated']); ?>
 

Re: mysql covert time

Posted: Tue Jan 26, 2010 3:07 pm
by AbraCadaver
Look at the manual for date() for the proper format for your needs:

Code: Select all

echo date('your format', strtotime($row_WADAspecials['date_added']));
Or you can use the MySQL DATE_FORMAT() in your query if using MySQL.

Re: mysql covert time

Posted: Tue Jan 26, 2010 4:58 pm
by bkchf123
thanks allset