getWeek

Modified on Tue, 22 Aug 2023

Description

Use this function to get the local week index of the given date.

Syntax

getWeek(date):number

Returns

Return ValueDescription
NumberReturns the local week index of the given date.

Sample

ExampleResultDescription
getWeek(2023-04-08)14The function extracts the week number from the date and returns it, which is 14.

To view all the Date functions, click here.

See Also