Skip to content

addTime

The addTime() function adds a TheTime duration to a TheDate or another TheTime.

Interactive example

Syntax

Classic signature

typescript
function addTime<
	GenericInput extends TheDate
>(
	input: GenericInput,
	time: TheTime
): TheDate

function addTime<
	GenericInput extends TheTime
>(
	input: GenericInput,
	time: TheTime
): TheTime

Curried signature

typescript
function addTime<
	GenericInput extends TheDate
>(
	time: TheTime
): (input: GenericInput) => TheDate

function addTime<
	GenericInput extends TheTime
>(
	time: TheTime
): (input: GenericInput) => TheTime

Parameters

  • time: Duration to add as a TheTime.
  • input: TheDate or TheTime to adjust.

Return value

A TheDate or TheTime with the added duration.

See also

Released under the MIT license.