Skip to content

createTimeOrThrow

The createTimeOrThrow() function builds a TheTime from a TheTime, a numeric value, or a SpoolingTime. It throws CreateTheTimeError when the input is invalid.

Interactive example

Syntax

typescript
function createTimeOrThrow(
	input: number | TheTime | SpoolingTime
): TheTime

Parameters

  • input: A time value (number), a TheTime, or a SpoolingTime.

Return value

A valid TheTime. If the value is out of bounds or inconsistent, a CreateTheTimeError is thrown.

See also

Released under the MIT license.