monthsDiff()
Table of Contents
Overview
The monthsDiff() function takes startDateTimeValue and endDateTimeValue as arguments. It returns the number of months between the given date-time values.
Return Type
Syntax
(OR)
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned number. | NUMBER |
<startDateTimeValue> | The starting date-time value. | DATE-TIME |
<endDateTimeValue> | The ending date-time value. | DATE-TIME |
- The time value is not taken into account while using this function.
- Please refer this help document to learn about the supported date-time formats.
Examples
endDate = '01-Jan-1990';
newEndDate = '01-Feb-1990';
numberOfMonths= monthsDiff(startDate, endDate); // returns 0
numOfMonths = monthsDiff(startDate, newEndDate); // returns 1
endDate = '01-Mar-2020';
info monthsDiff(startDate, endDate); // returns 1