MySQL | YEAR
Start your free 7-days trial now!
YEAR type is used to represent a year value. It is represented as follows:
YYYY or 'YYYY'
A few useful points to note:
Each year value is 1-byte
YEARtype is stored using 4 digits. MySQL 8.0 does not support 2-digit
Supported range is
2155. It also allows for the zero year
For columns with
YEAR data type, MySQL implicitly converts 1 or 2 digit strings / digits according to the below:
String / Digit
Converted YEAR value