Date or timestamp in milliseconds to change.
Number of years to subtract. Positive decimals use Math.floor; negative decimals use Math.ceil.
A new Date with the specified number of calendar years subtracted. Invalid inputs produce an invalid Date.
Subtract a number of calendar years from a date.
Positive decimal amounts are rounded with
Math.floor; negative decimal amounts are rounded withMath.ceil. A negative amount therefore adds calendar years. When the destination year does not contain the original day, the result is clamped to the final day of that month.Usage:
Output: