edate()
Table of Contents
Overview
The edate() function takes dateTimeValue and numberOfMonths as arguments. It returns the dateTimeValue after adding the specified number of months to it.
The date value (without time value) will be returned in the format specified in Application Settings.
Return Type
- Date-Time
Syntax
<variable> = <dateTimeValue>.edate(<numberOfMonths> );
(OR)
<variable >= edate(<dateTimeValue>, <numberOfMonths>);
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned date-time value. | DATE-TIME |
<dateTimeValue> | The date-time value to which the specified number of months will be added. The time value is not taken into account while using this function. A runtime error will be encountered if:
Please refer this help document to learn about the supported date-time formats. | DATE-TIME |
<numberOfMonths> | Variable which will contain the returned date-time value. A negative number will subtract the specified number of months from dateTimeValue. | NUMBER |
Examples
currentDate = '01-Jan-2019';
currentDateTime = '01-Jan-2019 15:00:00';
newDate = currentDate.edate(11); // returns '01-Dec-2019'
newDateTime = currentDateTime.edate(13); // returns '01-Feb-2020'
currentDateTime = '01-Jan-2019 15:00:00';
newDate = currentDate.edate(11); // returns '01-Dec-2019'
newDateTime = currentDateTime.edate(13); // returns '01-Feb-2020'