In MariaDB, YEAR()
is a built-in date and time function that returns the year from a given date expression.
It accepts one argument, which is the date you want to extract the year from.
It returns the year as a number in the range 1000
to 9999
. For zero dates (e.g. 0000-00-00
), the result is 0
.