YEAR Function

Returns the year part of a date/time string.

Syntax

YEAR(date)

Arguments

Return Value

An integer representing the specified year.

Example

PRINT YEAR('2016-03-07');  -- "2016"
PRINT YEAR('2015-07-23 22:06:53.742 -04:00'); -- "2015"