getWeekYear

Modified on Tue, 22 Aug 2023

Description

Use this function to get the local week-numbering year of the given date.

Syntax

getWeekYear(date:Date | number, options:undefined):number

Returns

Return ValueDescription
NumberReturns the local week-numbering year of the given date.

Sample

ExampleResultDescription
getWeekYear(2023-04-08)2023The function calculates the local week-numbering year of the given date, which is 2023, and returns it.

To view all the Date functions, click here.

See Also