when I retrieve my date and time from database and display as follow:
2003-03-14 14:42:18
How can I easily change the format into :
Mar 14th, 2003, 2:42pm
change data time format
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you're using MySQL:
For more info on DATE_FORMAT:
http://www.mysql.com/doc/en/Date_and_ti ... ml#IDX1298
Mac
Code: Select all
SELECT DATE_FORMAT(datefield, '%b %D, %Y, %l:%i%p') AS date FROM tablehttp://www.mysql.com/doc/en/Date_and_ti ... ml#IDX1298
Mac