Date values with two-digit years are ambiguous because the century is unknown. Such values must be interpreted into four-digit form because MySQL stores years internally using four digits.
For DATETIME,
DATE,
TIMESTAMP, and
YEAR types, MySQL interprets
dates specified with ambiguous year values using these rules:
Year values in the range 00-69 are
converted to 2000-2069.
Year values in the range 70-99 are
converted to 1970-1999.
Remember that these rules are only heuristics that provide reasonable guesses as to what your data values mean. If the rules used by MySQL do not produce the values you require, you must provide unambiguous input containing four-digit year values.
In MySQL, the YEAR data type can
store the years 0 and 1901
to 2155 in one byte and display them using
two or four digits. For input, all two-digit years are
considered to be in the range 1970 to
2069, which means that if you store
01 in a YEAR
column, MySQL Server treats it as 2001.
ORDER BY properly sorts
YEAR values that have two-digit
years.
Some functions like MIN() and
MAX() convert a
YEAR to a number. This means that
a value with a two-digit year does not work properly with these
functions. The fix in this case is to convert the
YEAR to four-digit year format.

User Comments
Add your own comment.