monthsBetween
This topic describes the syntax and usage of the monthsBetween function in Zoho Creator.
Description
The monthsBetween function returns a number in the range (1 - ) representing the number of months between the given start and end dates.
Syntax
The monthsBetween function syntax has the following arguments.
start_date - Required. The starting date. Dates should be entered by using the DATEVALUE function, or as results of other formulas or functions.
end_date - Required. The end date. Dates should be entered by using the DATEVALUE function, or as results of other formulas or functions.
Note: This function is supported only in free-flow scripting mode of Script Builder.
Example
a. In this example, the date format specified in the application settings page is dd-MMM-yyyy. The date returned by dateValue function is 20-May-2013. The date returned by edate(dat1,3) is 20-Aug-2013. The monthsBetween function returns 3.
str = "05-20-13";
dat1 = dateValue(str);
dat2 = edate(dat1,3);
monthsBetween = monthsBetween(dat1,dat2);
yearsBetween = yearsBetween(dat1,dat2);
