date      = new Date('2013-02-11');
next_date = new Date(date.setDate(date.getDate() + 1));

here's a demo http://jsfiddle.net/MEptb/

Answer from Sanjay Kamaruddin on Stack Overflow
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Date
Date - JavaScript | MDN
YYYY is the year, with four digits (0000 to 9999), or as an expanded year of + or - followed by six digits. The sign is required for expanded years. -000000 is explicitly disallowed as a valid year. MM is the month, with two digits (01 to 12). Defaults to 01. DD is the day of the month, with two digits (01 to 31).
๐ŸŒ
DEV Community
dev.to โ€บ lavary โ€บ how-to-add-days-to-a-date-in-javascript-without-a-library-3795
How to add days to a date in JavaScript (without a library) - DEV Community
February 5, 2023 - To add a few days to a date in JavaScript, you need to use setDate() on the Date object and increment the current day of the month by one or more days.
๐ŸŒ
Day.js
day.js.org โ€บ docs โ€บ en โ€บ display โ€บ format
Format ยท Day.js
dayjs().format() // current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00' dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]') // 'YYYYescape 2019-01-25T00:00:00-02:00Z' dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ javascript-add-date-by-days-in-javascript-28123
Add Date by Days in JavaScript
Use Date.prototype.getDate() and Date.prototype.setDate() to add n days to the given date. Use Date.prototype.toISOString() to return a string in yyyy-mm-dd format.
๐ŸŒ
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 ...
Top answer
1 of 16
1850

You can create one using Date.prototype.setDate():

Date.prototype.addDays = function(days) {
    var date = new Date(this.valueOf());
    date.setDate(date.getDate() + days);
    return date;
}

var date = new Date();

console.log(date.addDays(5));

This takes care of automatically incrementing the month if necessary, as noted here. For example:

8/31 + 1 day will become 9/1.

The problem with using setDate directly is that it's a mutator and that sort of thing is best avoided. ECMA saw fit to treat Date as a mutable class rather than an immutable structure.

2 of 16
1171

Correct Answer:

function addDays(date, days) {
  var result = new Date(date);
  result.setDate(result.getDate() + days);
  return result;
}

Incorrect Answer:

This answer sometimes provides the correct result but very often returns the wrong year and month. The only time this answer works is when the date that you are adding days to happens to have the current year and month.

// Don't do it this way!
function addDaysWRONG(date, days) {
  var result = new Date(); // not instatiated with date!!! DANGER
  result.setDate(date.getDate() + days);
  return result;
}

Proof / Example

Check this JsFiddle

// Correct
function addDays(date, days) {
    var result = new Date(date);
    result.setDate(result.getDate() + days);
    return result;
}

// Bad Year/Month
function addDaysWRONG(date, days) {
    var result = new Date();
    result.setDate(date.getDate() + days);
    return result;
}

// Bad during DST
function addDaysDstFail(date, days) {
    var dayms = (days * 24 * 60 * 60 * 1000);
    return new Date(date.getTime() + dayms);    
}

// TEST
function formatDate(date) {
    return (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();
}

$('tbody tr td:first-child').each(function () {
    var $in = $(this);
    var $out = $('<td/>').insertAfter($in).addClass("answer");
    var $outFail = $('<td/>').insertAfter($out);
    var $outDstFail = $('<td/>').insertAfter($outFail);
    var date = new Date($in.text());
    var correctDate = formatDate(addDays(date, 1));
    var failDate = formatDate(addDaysWRONG(date, 1));
    var failDstDate = formatDate(addDaysDstFail(date, 1));

    $out.text(correctDate);
    $outFail.text(failDate);
    $outDstFail.text(failDstDate);
    $outFail.addClass(correctDate == failDate ? "right" : "wrong");
    $outDstFail.addClass(correctDate == failDstDate ? "right" : "wrong");
});
body {
    font-size: 14px;
}

table {
    border-collapse:collapse;
}
table, td, th {
    border:1px solid black;
}
td {
    padding: 2px;
}

.wrong {
    color: red;
}
.right {
    color: green;
}
.answer {
    font-weight: bold;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<table>
    <tbody>
        <tr>
            <th colspan="4">DST Dates</th>
        </tr>
        <tr>
            <th>Input</th>
            <th>+1 Day</th>
            <th>+1 Day Fail</th>
            <th>+1 Day DST Fail</th>
        </tr>
        <tr><td>03/10/2013</td></tr>
        <tr><td>11/03/2013</td></tr>
        <tr><td>03/09/2014</td></tr>
        <tr><td>11/02/2014</td></tr>
        <tr><td>03/08/2015</td></tr>
        <tr><td>11/01/2015</td></tr>
        <tr>
            <th colspan="4">2013</th>
        </tr>
        <tr>
            <th>Input</th>
            <th>+1 Day</th>
            <th>+1 Day Fail</th>
            <th>+1 Day DST Fail</th>
        </tr>
        <tr><td>01/01/2013</td></tr>
        <tr><td>02/01/2013</td></tr>
        <tr><td>03/01/2013</td></tr>
        <tr><td>04/01/2013</td></tr>
        <tr><td>05/01/2013</td></tr>
        <tr><td>06/01/2013</td></tr>
        <tr><td>07/01/2013</td></tr>
        <tr><td>08/01/2013</td></tr>
        <tr><td>09/01/2013</td></tr>
        <tr><td>10/01/2013</td></tr>
        <tr><td>11/01/2013</td></tr>
        <tr><td>12/01/2013</td></tr>
        <tr>
            <th colspan="4">2014</th>
        </tr>
        <tr>
            <th>Input</th>
            <th>+1 Day</th>
            <th>+1 Day Fail</th>
            <th>+1 Day DST Fail</th>
        </tr>
        <tr><td>01/01/2014</td></tr>
        <tr><td>02/01/2014</td></tr>
        <tr><td>03/01/2014</td></tr>
        <tr><td>04/01/2014</td></tr>
        <tr><td>05/01/2014</td></tr>
        <tr><td>06/01/2014</td></tr>
        <tr><td>07/01/2014</td></tr>
        <tr><td>08/01/2014</td></tr>
        <tr><td>09/01/2014</td></tr>
        <tr><td>10/01/2014</td></tr>
        <tr><td>11/01/2014</td></tr>
        <tr><td>12/01/2014</td></tr>
        <tr>
            <th colspan="4">2015</th>
        </tr>
        <tr>
            <th>Input</th>
            <th>+1 Day</th>
            <th>+1 Day Fail</th>
            <th>+1 Day DST Fail</th>
        </tr>
        <tr><td>01/01/2015</td></tr>
        <tr><td>02/01/2015</td></tr>
        <tr><td>03/01/2015</td></tr>
        <tr><td>04/01/2015</td></tr>
        <tr><td>05/01/2015</td></tr>
        <tr><td>06/01/2015</td></tr>
        <tr><td>07/01/2015</td></tr>
        <tr><td>08/01/2015</td></tr>
        <tr><td>09/01/2015</td></tr>
        <tr><td>10/01/2015</td></tr>
        <tr><td>11/01/2015</td></tr>
        <tr><td>12/01/2015</td></tr>
    </tbody>
</table>

Find elsewhere
๐ŸŒ
Acrobatusers
answers.acrobatusers.com โ€บ Add-days-date-European-dd-mm-yyyy-q122650.aspx
Add days to date (European dd/mm/yyyy) (JavaScript)
*/ /* 24 hours / day; 60 min / ... new Date(num); /* Put the input date plus 1 days using util.printd into InputDate7 */ this.getField("InputDate7").value =util.printd("dd/mm/yyyy", d2); /* Add one day to Date1....
๐ŸŒ
MSR
rajamsr.com โ€บ home โ€บ how to add days to date in javascript with 3 examples
How to Add Days to Date in JavaScript With 3 Examples | MSR - Web Dev Simplified
January 18, 2024 - With this approach, you can add one day to a date by changing the numberOfDaysToAdd variable value to 1. To add 30 days to the date, you can change the numberOfDaysToAdd value to 30.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ How-to-add-number-of-days-to-JavaScript-Date
How to add number of days to JavaScript Date?
<!DOCTYPE html> <html> <head> <title>Example- add number of days to the Date object</title> </head> <body> <h2> Add Number of days to the JavaScript Date object using setDate( ) method </h2> <p> Click on the button to add 2 days to the current date/time.</p> <button onclick="add()">Click ...
๐ŸŒ
Tutorial Republic
tutorialrepublic.com โ€บ faq โ€บ how-to-add-days-to-current-date-in-javascript.php
How to Add Days to Current Date in JavaScript
Topic: JavaScript / jQueryPrev|Next ยท You can simply use the setDate() method to add number of days to current date using JavaScript. Also note that, if the day value is outside of the range of date values for the month, setDate() will update ...
๐ŸŒ
Tutorial Republic
tutorialrepublic.com โ€บ faq โ€บ how-to-format-javascript-date-as-yyyy-mm-dd.php
How to Format JavaScript Date as YYYY-MM-DD
// Create a date object from a ...ng("default", { day: "2-digit" }); // Generate yyyy-mm-dd date string var formattedDate = year + "-" + month + "-" + day; console.log(formattedDate); // Prints: 2022-05-04 ยท Here are some more ...
๐ŸŒ
TutorialsTeacher
tutorialsteacher.com โ€บ javascript โ€บ javascript-date
JavaScript Date: Create, Convert, Compare Dates in JavaScript
var date1 = new Date("February 2015-3"); var date2 = new Date("February-2015-3"); var date3 = new Date("February-2015-3"); var date4 = new Date("February,2015-3"); var date5 = new Date("February,2015,3"); var date6 = new Date("February*2015,3"); var date7 = new Date("February$2015$3"); var date8 = new Date("3-2-2015"); // MM-dd-YYYY var date9 = new Date("3/2/2015"); // MM-dd-YYYY
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ javascript-format-date-dd-mm-yyyy
How to Format a Date as DD/MM/YYYY in JavaScript | bobbyhadz
If you also need to include the time components, check out my other article: Format a Date as YYYY-MM-DD hh:mm:ss in JavaScript. You can also use the date-fns module to format a date as DD/MM/YYYY. First, make sure you have the module installed.
๐ŸŒ
Bugfender
bugfender.com โ€บ blog โ€บ javascript-date-and-time
The Definitive Guide to JavaScript Date and Time | Bugfender
February 18, 2025 - const date = new Date(); const day = date.getDate(); const month = date.getMonth() + 1; // The month index starts from 0 const year = date.getFullYear(); let currentDate = `${day}/${month}/${year}`; console.log(currentDate); // 10/9/2023 ...
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_date_formats.asp
JavaScript Date Formats
The ISO 8601 syntax (YYYY-MM-DD) is also the preferred JavaScript date format: const d = new Date("2015-03-25"); Try it Yourself ยป ยท The computed date will be relative to your time zone. Depending on your time zone, the result above will vary between March 24 and March 25. ISO dates can be written without specifying the day (YYYY-MM):
๐ŸŒ
Code with Hugo
codewithhugo.com โ€บ add-date-days-js
Add days to a Date in vanilla JavaScript ยท Code with Hugo
May 1, 2020 - While it would be very easy to reach for moment.js or another date manipulation library (date-fns, luxon, dayjs) to do something as simple as adding days to a Date in JavaScript, writing a short helper function might just be easier.