The YEAR Type


The YEAR type is a one-byte type used for representing years. It can be declared as YEAR(2) or YEAR(4) to specify a display width of two or four characters. The default is four characters if no width is given.

For four-digit format, MariaDB displays YEAR values in YYYY format, with a range of 1901 to 2155, or 0000. For two-digit format, MariaDB displays only the last two (least significant) digits; for example, 70 (1970 or 2070) or 69 (2069).

You can specify input YEAR values in a variety of formats:

Illegal YEAR values are converted to 0000.

See also , "Two-Digit Years in Dates".

Retornar