跳到主要内容

DATE

Returns a number that represents the date in the date-time code.

Syntax

expression.DATE(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberA number from 1900 or 1904 (depending on the workbook's date system) to 9999.
arg2RequiredApiRange | ApiName | numberA number from 1 to 12 representing the month of the year.
arg3RequiredApiRange | ApiName | numberA number from 1 to 31 representing the day of the month.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.DATE(2018, 3, 16));