Skip to content

toTimeValue

The toTimeValue() function converts a TheTime string into a numeric value (milliseconds). It applies the makeSafeTimeValue safeguards: rounding decimals and clamping between minTimeValue and maxTimeValue.

Interactive example

Syntax

typescript
function toTimeValue<
	GenericInput extends TheTime
>(
	input: GenericInput
): number

Parameters

  • input: Duration formatted as TheTime.

Return value

The numeric value in milliseconds, clamped to minTimeValue and maxTimeValue.

See also

Released under the MIT license.