Hello all,
I was browsing through the reference manual on the mysql.com web site and
found the following code examples for some date/time functions:
mysql> SELECT STR_TO_DATE('00/00/0000', '%m/%d/%Y');
-> '0000-00-00'
mysql> SELECT STR_TO_DATE('04/31/2004', '%m/%d/%Y');
-> '2004-04-31'
In each example above the first line is the code the second is the result.
Do these look backwards to anyone else? I'll admit I'm a newbie that's
browsing the boards and trying to decide if I want to learn MySQL and PHP,
but to me the following makes more sense:
mysql> SELECT STR_TO_DATE('2004-04-31', '%m/%d/%Y');
-> '04/31/2004'
The online manual's example would indicate that the "format" portion of the
function (%m/%d/%Y) should be specifying the format of the INPUT string.
I'm thinking that the "format" portion of the function should be specifying
the RESULT format as in my example (based upon my experience with Oracle and
Brio).
So, do I have a lot to learn or are the first two examples incorrect?
Thanks,
Phil