YEAR

Returns an integer that represents the year portion of the specified date.

Returns an integer that represents the year portion of the specified date.

Syntax

YEAR( date )

Behavior type

  • Immutable if thespecified date is a TIMESTAMP, DATE, VARCHAR, or INTERVAL

  • Stable if the specified date is aTIMESTAMPTZ

Parameters

date

The date to process, one of the following data types:

Examples

=> SELECT YEAR(CURRENT_DATE::DATE);
 YEAR
------
 2016
(1 row)

See also

YEAR_ISO