Skip to content

addSeconds

Adds a positive number of seconds to a TheDate.

Interactive example

Syntax

Classic signature

typescript
function addSeconds<
	GenericInput extends TheDate, 
	GenericSecond extends number
>(
	input: GenericInput,
	second: PositiveNumber<GenericSecond>
): TheDate

Curried signature

typescript
function addSeconds<GenericInput extends TheDate, GenericSecond extends number>(
	second: PositiveNumber<GenericSecond>
): (input: GenericInput) => TheDate

Parameters

  • second: Strictly positive number of seconds.
  • input: TheDate to adjust.

Return value

A TheDate moved forward by the requested number of seconds.

See also

Released under the MIT license.