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 > Formating Dates for MySQL 4.0.25

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-15-05, 10:26
danliles danliles is offline
Registered User
 
Join Date: Oct 2005
Posts: 1
Formating Dates for MySQL 4.0.25

This is a quick one for all you DB studs out there.

I'm trying to insert a date and I was using the STR_TO_DATE function but then I found out my hosting environment uses mySQL 4.0.25 which doesn't support this function.

Looking around on the web it looks like everyone just reformats the date to meet the my sql standard of YYYY-MM-DD, is that the best way to handle this or is there something more elegant?

Thanks for your input.

Dan
Reply With Quote
  #2 (permalink)  
Old 10-15-05, 23:53
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
A string as yyyy-mm-dd is the cleanest way to go. I believe there are other formats you can use with the date field but I think the yyyy-mm-dd is the easiest to "look" at.
Reply With Quote
  #3 (permalink)  
Old 10-16-05, 09:01
elorob elorob is offline
Registered User
 
Join Date: Sep 2005
Posts: 4
I believe yyyy-mm-dd is also the ansi (or iso - I forget) standard and works on all all dbs I've tried it on - Sybase, DB2, SQL Server, MS Access.
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