differenceInWeeks

Modified on Tue, 22 Aug 2023

Description

Use this function to get the number of full weeks between two dates.

Syntax

differenceInWeeks(date1, date2, options)

Returns

Return ValueDescription
NumberReturn the number of full weeks between two dates.

Sample

ExampleResultDescription
differenceInWeeks (2023-1-1, 2023-4-3)13In this example, start_date is January 1, 2023, and the end_date is April 3, 2023. This function calculates the number of full weeks between these two dates (13 weeks).

To view all the Date functions, click here.

See Also