Hello,
When a user registeres to my website it saves the date they joined in the format yyyy-mm-dd
How can I display the date they joined as dd mm yyyy (22nd march 2009 for example)
Thanks.
Showing date as different format?
Moderator: General Moderators
Re: Showing date as different format?
If you stored the date in the database as YYYY-MM-DD then use MySQL's DATE_FORMAT function.
Code: Select all
SELECT ...DATE_FORMAT(field, "%D %M %Y")...Re: Showing date as different format?
thanks! but how do I change it from say 1 may 2009 to 1st may 2009?
-
kalebaustin
- Forum Newbie
- Posts: 12
- Joined: Mon Nov 19, 2007 11:28 am
Re: Showing date as different format?
DATE_FORMAT(field, "%D %M %Y") will return (for today) 6th June 2009
the %D = Day of the month with English suffix (0th, 1st, 2nd, 3rd, …)
Source: http://dev.mysql.com/doc/refman/5.1/en/ ... ate-format
the %D = Day of the month with English suffix (0th, 1st, 2nd, 3rd, …)
Source: http://dev.mysql.com/doc/refman/5.1/en/ ... ate-format