Re: change date format in MYSQL
Posted by:
Erik Cerpnjak ()
Date: February 01, 2009 12:39PM
Mysql has this date format: YYYY-mm-dd. You can change the format mysql stores the date, but it is strongly advised and also easier if you only output your date in a format you preffer:
Example:
Lets say you have a collumn named mydate. then you would write your query like this:
SELECT DATE_FORMAT(mydate, '%d/%m/%Y') as mydate from mytable
The date format from your DB looks like this:
2009-02-01
Mysql will output this date as:
01/02/2009
I hope this helps...
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.