2808 explained code solutions for 75 technologies

nodejsHow to add years to date

let dt = new Date();
dt.setFullYear(dt.getFullYear() + 5);ctrl + c
new Date

create date/time management object


sets year for the given date object


returns year of the date

dt.getFullYear() + 5

adds 5 years to the given date


number of months to add