differenceInCalendarMonths

Modified on Tue, 22 Aug 2023

Description

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

Syntax

differenceInCalendarMonths(dateLeft, dateRight)

Returns

Return ValueDescription
NumberReturns the total number of months.

Sample

ExampleResultDescription
differenceInCalendarMonths (2022-1-1, 2023-4-1)15In this example, the output will be 15.

To view all the Date functions, click here.

See Also