Add 30 days to a Current date - JS

Sarath picture Sarath · Jun 29, 2017 · Viewed 29.2k times · Source

I want to add 30 days to current date and get in a format.

Im confused to add a 30 to a date and get new.

Its pure JS Solution needed.

Format : June 10, 2017

Answer

Lennholm picture Lennholm · Jun 29, 2017
var date = new Date(); // Now
date.setDate(date.getDate() + 30); // Set now + 30 days as the new date
console.log(date);