Subtract a specified amount of time (in units) from date object.
subtractTime(new Date(2020, 3, 10), 5, TimeUnit.HOURS) // "2020-04-10T02:00:00.000Z"subtractTime(new Date(2020, 3, 10), 3, TimeUnit.DAYS) // "2020-04-07T07:00:00.000Z"subtractTime(new Date(2020, 3, 10), 1, TimeUnit.MONTHS) // "2020-03-10T07:00:00.000Z"
JavaScript date object after subtracting the specified amount of time
JavaScript date object
Number of time units to subtract
String token representing time unit
Generated using TypeDoc
Subtract a specified amount of time (in units) from date object.
Example
Returns
JavaScript date object after subtracting the specified amount of time