year

Description

Syntax

INT YEAR(DATETIME date)

Returns the year part of the date type, ranging from 1000 to 9999

The parameter is Date or Datetime type

example

  1. mysql> select year('1987-01-01');
  2. +-----------------------------+
  3. | year('1987-01-01 00:00:00') |
  4. +-----------------------------+
  5. | 1987 |
  6. +-----------------------------+

keyword

YEAR