跳到主要内容

DAYS

Returns the number of days between the two dates.

Syntax

expression.DAYS(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberStart date from which days will be counted.
arg2RequiredApiRange | ApiName | numberEnd date until which days will be counted.

Returns

number

Example

const worksheet = Api.GetActiveSheet();

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

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