differenceInQuarters

Modified on Tue, 22 Aug 2023

Description

Use this function to get the number of quarters between the given dates.

Syntax

differenceInQuarters(date1, date2)

Returns

Return ValueDescription
NumberReturn the number of quarters between the given dates.

Sample

ExampleResultDescription
differenceInQuarters (2022-06-30, 2023-12-31)6In this example, date1 is June 30, 2022, and date2 is December 31, 2023. The function returns 6, which is the number of full quarters between the two dates.

To view all the Date functions, click here.

See Also