DATEVALUE
function DATEVALUE(arg1: string = null): number
Description
Converts a date in the form of text to a number that represents the date in the date-time code.
Parameters
- arg1
string
null 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
number
Try It
const oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.DATEVALUE("2018-3-16");
oWorksheet.GetRange("C1").SetValue(ans);