B.3.4.2 Problems Using DATE Columns The format of a
As a convenience, MySQL automatically converts a date to a number if the date is used in numeric context and vice versa. MySQL also permits a
“relaxed” string format when updating and in a When you compare a
For those exceptions, the comparison is done by converting the objects to strings and performing a string comparison. To be on the safe side, assume that strings are compared as strings and use the appropriate string functions if you want to compare a temporal value to a string. The special “zero” date Because MySQL performs the conversions just described, the following statements work (assume that
However, the following statement does not work:
If you enable the MySQL permits you to store dates where the day or month and day are zero. This is convenient if you want to store a birthdate in a MySQL permits you to store a “zero” value of To have MySQL check all dates and accept only legal dates (unless overridden by |