...

View Full Version : Outputting a date?



stfc_boy
08-08-2008, 12:04 PM
Hi All,

I have a date in my database in this format 2008-08-01 12:00:00

So when I want to print the date to my actual site I use this query:


SELECT *, DATE_FORMAT(published, '%W, %D %M, %Y') AS formatted_date

Which outputs: Friday, 1st August, 2008
But how would I output the date in this format: Fri 8th Aug (No Year)
Thanks
Chris

abduraooft
08-08-2008, 12:18 PM
Have you checked http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format
To remove the year, just remove , %Y part. Or do you want to change the date from 1 to 8 ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum