Nicolas Bouliane

Adding days to a Javascript Date object

Posted on

Adding an arbitrary amount of days is easy with Javascript. Using the setDays() method, it’s pretty self-explanatory:

//Adds a day to today 
var today = new Date();
var tomorrow = new Date();
tomorrow.setDate(today.getDate()+1); //Tomorrow = today + 1 day