If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Change Date Format in Mysql Table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-06, 07:36
Chimp8471 Chimp8471 is offline
Registered User
 
Join Date: Mar 2003
Posts: 225
Change Date Format in Mysql Table

currently my MysQL table store a feild called

DOB

and the date has to be entered as

yyyy/mm/dd

i would like it to be

dd/mm/yyyy

how do i do this please

sorry for asking such a silly question

Andy
Reply With Quote
  #2 (permalink)  
Old 07-18-06, 15:01
dbmab dbmab is offline
Registered User
 
Join Date: Apr 2006
Location: Denver, Co. USA
Posts: 240
Mysql uses the yyyy-mm-dd DATE/DATETIME format as it makes sorting and comparisons work correctly.

If you want mysql to covert the format on input and output, you need to use the - DATE_FORMAT(date,format) - function.

This function is of some use as well -
Quote:
GET_FORMAT(DATE|TIME|DATETIME, 'EUR'|'USA'|'JIS'|'ISO'|'INTERNAL')

Returns a format string. This function is useful in combination with the DATE_FORMAT() and the STR_TO_DATE() functions.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On