I am using mysql and want to know about the mysql Dare datatyep.
I have enter the data as 05-03-2010.
on display it shows it as 2010-03-05.
I want to set the mysql as 05-03-2010 forever when i display the date.
please help.
Adil
date problem?
Moderator: General Moderators
Re: date problem?
This is not a problem with mysql DATE, its just how dates are stored. You format the date each time it is fetched from the database with the DATE_FORMAT(date,format) function
http://dev.mysql.com/doc/refman/5.1/en/ ... ate-format
Example:
http://dev.mysql.com/doc/refman/5.1/en/ ... ate-format
Example:
Code: Select all
SELECT DATE_FORMAT(date, '%d-$c-%Y %M %Y') AS date,other_column FROM tbl_name