javascript add 1 day to new date 1

javascript add 1 day to new date

var date = new Date();
// add 1 day
date.setDate(date.getDate() + 1);

Here is what the above code is Doing:
1. We create a new Date object.
2. We add 1 day to the date.
3. We set the cookie to expire in 1 day.

Similar Posts