lastDayOfYear

Modified on Thu, 24 Aug 2023

Description

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

Syntax

lastDayOfYear(date)

Returns

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

Sample

ExampleResultDescription
lastDayOfYear(2023-04-09)2023-12-31Returns the last day of the year for April 9, 2023, in the local timezone, which is Sunday, December 31, 2023.

To view all the Date functions, click here.

See Also