Skip to main content



Year Function

Returns the year for a given Date or DateTime.

Syntax 1

Year()

Returns the year for a given Date or DateTime.

Syntax 2

Year(dateTime)

Returns the year for a given Date or DateTime.

Arguments

dateTime DateTime - A DateTime or Date.

Remarks

Example:

Year("2005-1-28"); // returns 2005

Example:

Year(); // returns the current year