To add one day to a date object:

var date = new Date();

// add a day
date.setDate(date.getDate() + 1);
Answer from RobG on Stack Overflow
Top answer
1 of 13
481

To add one day to a date object:

var date = new Date();

// add a day
date.setDate(date.getDate() + 1);
2 of 13
90

In my humble opinion the best way is to just add a full day in milliseconds, depending on how you factor your code it can mess up if you are on the last day of the month.

For example Feb 28 or march 31.

Here is an example of how I would do it:

var current = new Date(); //'Mar 11 2015' current.getTime() = 1426060964567
var followingDay = new Date(current.getTime() + 86400000); // + 1 day in ms
followingDay.toLocaleDateString();

Imho this insures accuracy

Here is another example. I do not like that. It can work for you but not as clean as example above.

var today = new Date('12/31/2015');
var tomorrow = new Date(today);
tomorrow.setDate(today.getDate()+1);
tomorrow.toLocaleDateString();

Imho this === 'POOP'

So some of you have had gripes about my millisecond approach because of day light savings time. So I'm going to bash this out. First, Some countries and states do not have Day light savings time. Second Adding exactly 24 hours is a full day. If the date number does not change once a year but then gets fixed 6 months later I don't see a problem there. But for the purpose of being definite and having to deal with allot the evil Date() I have thought this through and now thoroughly hate Date. So this is my new Approach.

var dd = new Date(); // or any date and time you care about 
var dateArray =  dd.toISOString().split('T')[0].split('-').concat( dd.toISOString().split('T')[1].split(':') );
// ["2016", "07", "04", "00", "17", "58.849Z"] at Z 

Now for the fun part!

var date = { 
    day: dateArray[2],
    month: dateArray[1],
    year: dateArray[0],
    hour: dateArray[3],
    minutes: dateArray[4],
    seconds:dateArray[5].split('.')[0],
    milliseconds: dateArray[5].split('.')[1].replace('Z','')
}

Now we have our Official Valid international Date Object clearly written out at Zulu meridian. Now to change the date

dd.setDate(dd.getDate()+1); // this gives you one full calendar date forward
tomorrow.setDate(dd.getTime() + 86400000);// this gives your 24 hours into the future. do what you want with it.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › Date
Date() constructor - JavaScript | MDN
The following examples show several ways to create JavaScript dates: ... const today = new Date(); const birthday = new Date("December 17, 1995 03:24:00"); // DISCOURAGED: may not work in all runtimes const birthday = new Date("1995-12-17T03:24:00"); // This is standardized and will work reliably ...
🌐
Medium
medium.com › @gaelgthomas › add-one-day-to-date-in-javascript-6b7d98b0edce
Add One Day to Date in JavaScript | by Gaël Thomas | Medium
December 21, 2022 - The getDate() function will return 5. Then you can add one day to this number 5 + 1 = 6. Finally, use setDate() to update the day of the month for your current date object. ... // Create a date const todayDate = new Date() // Before adding 1 ...
Top answer
1 of 16
980

Three options for you:

1. Using just JavaScript's Date object (no libraries):

My previous answer for #1 was wrong (it added 24 hours, failing to account for transitions to and from daylight saving time; Clever Human pointed out that it would fail with November 7, 2010 in the Eastern timezone). Instead, Jigar's answer is the correct way to do this without a library:

// To do it in local time
var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);

// To do it in UTC
var tomorrow = new Date();
tomorrow.setUTCDate(tomorrow.getUTCDate() + 1);

This works even for the last day of a month (or year), because the JavaScript date object is smart about rollover:

// (local time)
var lastDayOf2015 = new Date(2015, 11, 31);
console.log("Last day of 2015: " + lastDayOf2015.toISOString());
var nextDay = new Date(+lastDayOf2015);
var dateValue = nextDay.getDate() + 1;
console.log("Setting the 'date' part to " + dateValue);
nextDay.setDate(dateValue);
console.log("Resulting date: " + nextDay.toISOString());

2. Using MomentJS:

var today = moment();
var tomorrow = moment(today).add(1, 'days');

(Beware that add modifies the instance you call it on, rather than returning a new instance, so today.add(1, 'days') would modify today. That's why we start with a cloning op on var tomorrow = ....)

3. Using DateJS, but it hasn't been updated in a long time:

var today = new Date(); // Or Date.today()
var tomorrow = today.add(1).day();
2 of 16
195
var myDate = new Date();

//add a day to the date
myDate.setDate(myDate.getDate() + 1);
🌐
W3Schools
w3schools.com › js › js_dates.asp
JavaScript Dates
One and two digit years will be ... 01, 1970. Zero time is January 01, 1970 00:00:00 UTC. One day (24 hours) is 86 400 000 milliseconds....
🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-add-1-day-to-date
How to Add 1 Day to a Date using JavaScript | bobbyhadz
The Date.getDate() method returns an integer between 1 and 31 that represents the day of the month for the date. ... The setDate() method takes a number that represents the day of the month as a parameter and sets the value on the Date.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-add-days-to-date-in-javascript
How to Add Days to Date in JavaScript? - GeeksforGeeks
July 23, 2025 - The setDate() method allows you to modify the day of the month for a Date object. To use this method, you start by creating a Date object that represents the current date. You can then add a specific number of days to this date and assign the ...
🌐
Mastering JS
masteringjs.io › tutorials › fundamentals › date-add-days
JavaScript Add Days to Date - Mastering JS
So if you want to immediately use the date with a given number of days added, you can do the following: const date = new Date('2022-06-01'); // June 1, 2022 UTC time new Date( date.setDate(date.getDate() + 37) ); // July 8, 2022 UTC time
Find elsewhere
🌐
Reddit
reddit.com › r/learnjavascript › javascript returning 1 day less?
r/learnjavascript on Reddit: Javascript returning 1 day less?
March 3, 2023 -

Hi, I am working on a global project and unfortunately have to deal with dates.

There are some formatting requirements which requires me to only show YYYY-MM-DD

So the process is this:

User selects date -> String gets converted to new Date(str) -> Formate to YYYY-MM-DD

However, where I'm from, the dates are turning out fine. But my users in NA are getting 1 day less. I assume this is because new Date() is converting the time to UTC timezone.

What are my options to deal with this? Do I manually detect everyone's local timezone and try to work with that? Does using a library like date-fns deal with this issue automatically?

🌐
Tutorial Republic
tutorialrepublic.com › faq › how-to-add-days-to-current-date-in-javascript.php
How to Add Days to Current Date in JavaScript
Similarly, you can also add number of days to a particular date in JavaScript. ... // Specific date var date = new Date('August 21, 2021 16:45:30'); // Add ten days to specified date date.setDate(date.getDate() + 10); console.log(date);
🌐
Code with Hugo
codewithhugo.com › add-date-days-js
Add days to a Date in vanilla JavaScript · Code with Hugo
May 1, 2020 - ... function addDays(date, days) { const copy = new Date(Number(date)) copy.setDate(date.getDate() + days) return copy } const date = new Date(); const newDate = addDays(date, 10);
🌐
DEV Community
dev.to › gaelgthomas › add-one-day-to-date-in-javascript-45n2
Add One Day to Date in JavaScript - DEV Community
December 21, 2022 - The getDate() function will return 5. Then you can add one day to this number 5 + 1 = 6. Finally, use setDate() to update the day of the month for your current date object. ... // Create a date const todayDate = new Date() // Before adding 1 ...
🌐
CoreUI
coreui.io › answers › how-to-add-days-to-date-in-javascript
How to add days to date in JavaScript · CoreUI
September 30, 2025 - Use setDate() with getDate() to safely add days to any date. const date = new Date() date.setDate(date.getDate() + 7) The setDate() method automatically handles overflow when adding days that cross month or year boundaries.
🌐
W3Schools
w3schools.com › jsref › jsref_setdate.asp
JavaScript Date setDate() Method
const d = new Date("2025-01-15"); d.setDate(32); Try it Yourself » · setFullYear() setMonth() setUTCDate() setUTCMonth() setUTCFullYear() Date.setDate(day) setDate() is an ECMAScript1 (JavaScript 1997) feature. It is supported in all browsers: JavaScript Dates · JavaScript Date Formats · JavaScript Date Get Methods · JavaScript Date Set Methods · ❮ Previous JavaScript Date Reference Next ❯ · ★ +1 ·
🌐
DEV Community
dev.to › zachgoll › a-complete-guide-to-javascript-dates-and-why-your-date-is-off-by-1-day-fi1
A Complete Guide to JavaScript Dates (and why your date is off by 1 day) - DEV Community
March 31, 2024 - Since we are using January 1st, 2020, and the extra day gets added in February, we need to exclude the 2020 leap year in the calc, which leaves us with 12 total leap years since Jan 1st, 1970. And if we convert years to days: ... Of course! The value will just be negative. const d = new Date('1912-06-23'); console.log(d.valueOf()) // -1815350400000
🌐
Medium
medium.com › @sungbinkim98 › is-your-javascript-date-one-day-off-c56afb37e4bc
Is your JavaScript Date one day off? | by Sungbin Kim | Medium
August 1, 2024 - For example, suppose the value of a date input is "2023-09-15" , which is then converted to a Date object by new Date("2023-09-15") . If this Date object is printed to an user in New York, they will see "2023-09-14" .
🌐
Delft Stack
delftstack.com › home › howto › javascript › javascript add days to date
How to Add Days to Current Date in JavaScript | Delft Stack
February 2, 2024 - If it was 31/03/2020, it shall be 01/04/2020 as the only valid range is [1, 31]. Let’s see the following example of adding days to the Date object. function addDaysToDate(date, days) { var res = new Date(date); res.setDate(res.getDate() + ...