跳到主要内容

TIME

Converts hours, minutes and seconds given as numbers to a serial number, formatted with the time format.

Syntax

expression.TIME(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberA number from 0 to 23 representing the hour.
arg2RequiredApiRange | ApiName | numberA number from 0 to 59 representing the minute.
arg3RequiredApiRange | ApiName | numberA number from 0 to 59 representing the second.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.TIME(23, 4, 39));