Skip to main content
Inspiring
January 15, 2010
Question

Interesting FYI: MySQL and "mm/dd/yyyy" date constants

  • January 15, 2010
  • 1 reply
  • 483 views

On the MySQL server that I just tried it on...  date constants of the format "m/d/yyyy" did not work.

But they were accepted, without comment, and generated a zero-rows-output query result that did not fail.

Recoding the query output to use "YYYY-MM-DD" format produced the desired results.  (I used "ParseDate()" and "DateFormat()" to do the magick.)

It really surprised me that MySQL would be given what I guess it considers to be an un-parseable date, and process it without generating any error.  Hence, this "FYI."

This topic has been closed for replies.

1 reply

Inspiring
January 29, 2010

Can you provide some code to demonstrate this (with the table-create query too would be helpful for my lazy arse, today, too, if poss ;-)

And is the result the same via JDBC as it is via other MySQL clients?

--

Adam