Retrieve the year component from a date.
SELECT YEAR(“2017-06-15”); |
The YEAR() function returns the numeric year part for a given date, which ranges from 1000 to 9999.
YEAR(date) |
Parameter |
Description |
date |
Required: The date or datetime from which to extract the year. |
Works in: |
From MySQL version 4.0 |
Retrieve the numeric year component of a date.
SELECT YEAR(“2017-06-15 09:34:21”); |
Retrieve the numeric year from the current system date.
SELECT YEAR(CURDATE()); |