getYear

Modified on Tue, 22 Aug 2023

Description

Use this function to get the year of the given date.

Syntax

getYear(date)

Returns

Return ValueDescription
NumberReturns the year of the given date.

Sample

ExampleResultDescription
getYear(2023-04-09)2023The year of the date is 2023.

To view all the Date functions, click here.

See Also