Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add 30 days to a Current date - JS [duplicate]

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

like image 835
Sarath Avatar asked Jun 29 '17 13:06

Sarath


1 Answers

var date = new Date(); // Now
date.setDate(date.getDate() + 30); // Set now + 30 days as the new date
console.log(date);
like image 189
Lennholm Avatar answered Sep 24 '22 00:09

Lennholm