endOfYear

Modified on Thu, 24 Aug 2023

Description

Use this function to obtain the end of a year for the given date. The result will be in the local timezone.

Syntax

endOfYear(date)

Returns

Return ValueDescription
DateReturns a Date object representing the end of the year for the given date in the local timezone.

Sample

ExampleResultDescription
endOfYear(2022-07-15)2022-12-31Returns the end of the year for July 15, 2022, in the local timezone, which is December 31, 2022.

To view all the Date functions, click here.

See Also