Skip to main content

TIMEVALUE

Converts a text time to a serial number for a time, a number from 0 (12:00:00 AM) to 0.999988426 (11:59:59 PM). Format the number with a time format after entering the formula.

Syntax

expression.TIMEVALUE(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | stringA text string that represents a time in one of the time formats (date information in the string is ignored).

Returns

number

Example

const worksheet = Api.GetActiveSheet();

let func = Api.GetWorksheetFunction();
let ans = func.TIMEVALUE("11/5/18 11:17:00 am");

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