Skip to content

addHours

Adds a number of hours to a TheDate without manipulating milliseconds directly.

Interactive example

Syntax

Classic signature

typescript
function addHours<
	GenericInput extends TheDate | SerializedTheDate, 
	GenericHour extends number
>(
	input: GenericInput,
	hour: GenericHour
): TheDate

Curried signature

typescript
function addHours<
	GenericInput extends TheDate | SerializedTheDate, 
	GenericHour extends number
>(
	hour: GenericHour
): (input: GenericInput) => TheDate

Parameters

  • hour: Number of hours.
  • input: TheDate or SerializedTheDate.

Return value

A TheDate moved forward by the requested number of hours.

See also

Released under the MIT license.