Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/date_fns/index.js>addYears

date-fns Deno package
Go to Latest
function addYears
import { addYears } from "https://deno.land/x/date_fns@v2.0.0-beta.2/index.js";

Examples

// Add 5 years to 1 September 2014: var result = addYears(new Date(2014, 8, 1), 5) //=> Sun Sep 01 2019 00:00:00

Parameters

dirtyDate
  • the date to be changed
dirtyAmount
  • the amount of years to be added