ID EN
Date and Time Functions

YEAR(date)

MySQL 8.4

Returns the year for date, in the range 1000 to 9999, or 0 for the “zero” date. Returns NULL if date is NULL.

Syntax

MYSQL
SELECT YEAR('1987-01-01');
1987

Examples

Example
MYSQL
SELECT YEAR('1987-01-01');
1987