跳到主要内容

EDATE

Returns the serial number of the date which comes the indicated number of months before or after the start date.

Syntax

expression.EDATE(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberA serial date number that represents the start date.
arg2RequiredApiRange | ApiName | numberThe number of months before or after the start date.

Returns

number

Example

const worksheet = Api.GetActiveSheet();

let func = Api.GetWorksheetFunction();
let ans = func.EDATE("3/16/2018", 7);

worksheet.GetRange("C1").SetValue(ans);