2808 explained code solutions for 75 technologies

nodejsHow to add months to date

let dt = new Date();
dt.setMonth(dt.getMonth() + 4);ctrl + c
new Date

create date/time management object


sets months for the given date object


returns months of the date

dt.getMonth() + 4

adds 4 months to the given date


number of months to add