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') 124year;
  4. +-----------------------------+
  5. | 1987 |
  6. +-----------------------------+
  7. ##keyword
  8. YEAR