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:

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:

Mysql will output this date as:

I hope this helps...

Options: ReplyQuote

Written By
December 18, 2006 02:56AM
December 18, 2006 09:34AM
December 19, 2006 09:56AM
Re: change date format in MYSQL
February 01, 2009 12:39PM

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.