YEAR

YEAR takes a date object or a function such as NOW and returns an integer representing the year on which it falls. Use the coerce-to-string function to convert the result to a string. The structure of the date response returned follows the ISO 8601 standard.

/ - operations can be used with the YEAR function, such as YEAR() - 5 or YEAR() + 10.

Function category: Date

Syntax

YEAR(arg1)

Arguments

Description

arg1

Date object or a function that resolves to a date object.

Example 1

Enter the following into the Formula editor to return the current year using the NOW function.

# Find the current day
YEAR(NOW())
# This function returns
2020
# if this is the current year

Example 2

Enter the following into the Formula editor to return the current year as a string using the YEAR function wrapped in the coerce-to-string function and having the NOW function as the argument.

# Find the current year and return a string
coerce.to-string(YEAR(NOW()))
# This function returns the string
"2020"
# if this is the current year