getMillisecondsUntil()function

getMillisecondsUntil(target: PossibleDate, current?: PossibleDate, caller: AnyCaller = getMillisecondsUntil): number
ParamType
targetPossibleDate
Date to count up to. required
currentPossibleDate
Date to count from (defaults to now).
callerAnyCaller
Function to attribute a thrown error to (defaults to getMillisecondsUntil itself). Defaults to getMillisecondsUntil
Return
number
Number of milliseconds from current to target (negative if target is in the past).
Throws
RequiredError
If target or current cannot be converted to a valid date.

Count the milliseconds until a date.

Examples

getMillisecondsUntil("2099-01-01") // 2303683200000