View Full Version : change data time format
04-10-2003, 04:19 AM
when I retrieve my date and time from database and display as follow:
How can I easily change the format into :
Mar 14th, 2003, 2:42pm
04-10-2003, 07:42 AM
$date = date("F j, Y, g:i a", $retrieved_from_db);
You can check this page for more info on the date function and other formatting options :
This will work only if the date stored in your db is stored as a unix timestamp which means you got it with the time() function.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.