Mega Code Archive

 
Categories / MySQL Tutorial / Date Time Functions
 

YEAR(date) returns the 4-digit numeric year of a given date

mysql> mysql> SELECT YEAR('01/12/25 11:00:00'); +---------------------------+ | YEAR('01/12/25 11:00:00') | +---------------------------+ |                      2001 | +---------------------------+ 1 row in set (0.00 sec) mysql>