Web Hosting Talk







View Full Version : Changing the view of the database date?


BenSeagrave
09-11-2009, 06:39 PM
Hey

I have a database with a table including blog entries and a date the date is set to year-month-day format, How can i change it to something else, as i tried to change it to day-month-year so it will look like 11 September 2009 for example

Thanks

mattle
09-11-2009, 08:00 PM
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html, or the appropriate documentation for your unnamed database.

Neseema M M
09-12-2009, 03:09 AM
You can use like this

select date_format(date, '%d %M %Y') as formatted_date from table_name;

Where date is the name of your date field, and formatted_date is a variable name which you can use to retrieve the value.