computeTime
The computeTime() function converts a TheTime or SerializedTheTime into a numeric value in the requested unit.
Interactive example
Syntax
Classic signature
typescript
function computeTime(
input: TheTime | SerializedTheTime,
unit: "week" | "day" | "hour" | "minute" | "second" | "millisecond"
): numberCurried signature
typescript
function computeTime(
unit: "week" | "day" | "hour" | "minute" | "second" | "millisecond"
): (input: TheTime | SerializedTheTime) => numberParameters
input: Duration value (TheTimeorSerializedTheTime).unit: Target unit.
Return value
A numeric value converted to the requested unit.
