Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005

    Unanswered: 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.


  2. #2
    Join Date
    Mar 2004
    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.

  3. #3
    Join Date
    Sep 2005
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts