YEAR(date)

Description: Returns the year of date (a date, or date and time) in the range 1000 to 9999.

Example:

  • YEAR('2000-01-01') returns 2000.

See also: YEARWEEK()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.