javascriptdatejs

Add 30 days to a Current date - JS


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


Solution

  • var date = new Date(); // Now
    date.setDate(date.getDate() + 30); // Set now + 30 days as the new date
    console.log(date);