TRY NEW VERSION

DATEVALUE

DATEVALUE(arg1) → { number }

Converts a date in the form of text to a number that represents the date in the date-time code.

Parameters:

Name Type Description
arg1 string

The text that represents a date, between 1/1/1900 or 1/1/1904 (depending on the workbook's date system) and 12/31/9999.

Returns:

Type
number

Example

Copy code
builder.CreateFile("xlsx");

const oWorksheet = Api.GetActiveSheet();

var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.DATEVALUE("2018-3-16"); 

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

builder.SaveFile("xlsx", "DATEVALUE.xlsx");
builder.CloseFile();

Resulting document