edate()

edate()

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>);
ParameterDescriptionData 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:

  • the date value exceeds the number of days in that month.
  • an incorrect month value is specified.
  • the hour value, or the minutes value, or the seconds value is specified in more than 2 digits.
  • the year value has more than 4 digits.

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'

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com