addMilliseconds()function

addMilliseconds(change: number, target?: PossibleDate, caller: AnyCaller = addMilliseconds): Date
ParamType
changenumber
The number of milliseconds to add (negative numbers subtract). required
targetPossibleDate
Any value that can be converted to a date (defaults to "now").
callerAnyCaller
Function to attribute a thrown error to (defaults to addMilliseconds itself). Defaults to addMilliseconds
Return
Date
A new Date instance offset by change milliseconds.
Throws
RequiredError
If target couldn't be converted to a valid date.

Return a new date that increases or decreases the milliseconds based on an input date.

Examples

addMilliseconds(500, "2003-09-12T00:00:00") // Date instance for 2003-09-12T00:00:00.500