Skip to content

subtractMilliseconds

Subtracts a positive number of milliseconds from a TheDate.

Interactive example

Syntax

Classic signature

typescript
function subtractMilliseconds<
	GenericInput extends TheDate, 
	GenericMillisecond extends number
>(
	input: GenericInput,
	millisecond: PositiveNumber<GenericMillisecond>
): TheDate

Curried signature

typescript
function subtractMilliseconds<
	GenericInput extends TheDate, 
	GenericMillisecond extends number
>(
	millisecond: PositiveNumber<GenericMillisecond>
): (input: GenericInput) => TheDate

Parameters

  • millisecond: Milliseconds to remove.
  • input: Original date.

Return value

A TheDate moved back by the provided number of milliseconds.

See also

Released under the MIT license.