Skip to main content

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
arg1RequiredApiRangeApiNamenumber
arg2RequiredApiRangeApiNamenumber

Returns

number

Example

const oWorksheet = Api.GetActiveSheet();

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

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