addHours
Date
stable
Return a new Date shifted by the given number of hours. The original date is never mutated.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- daterequiredDate
- The base date. Not mutated.
- amountrequirednumber
- Number of hours to add. Negative values subtract hours.
API
Return value
The value returned by this util.
- A new Date instance offset by the specified number of hours.
Usage
Examples
Ready-to-paste usage snippets.
Add hours to a date