Formatting Dates and Times
DATE_FORMAT(date, format) and TIME_FORMAT assist in the representation of dates and times in formats other than the MySQL default format. Three examples illustrate the syntax:
SELECT DATE_FORMAT('2005-12-31', '%M %d %Y')
December 31 2005
SELECT DATE_FORMAT('2005-12-31', '%D of %M')
31st of December
SELECT TIME_FORMAT('02:17', '%H')
02
Reputation Points: 101
Solved Threads: 134
Practically a Posting Shark
Offline 870 posts
since Sep 2009