🎓 Free Capstone Projects with Full Documentation, ER Diagrams & Source Code — Updated Weekly for 2026
👨‍💻 Free Source Code & Capstone Projects for Developers

How to get tomorrow’s date in JavaScript? Effective Solutions

In this article, we will explore how to get tomorrow’s date in JavaScript with this effective solution.

Our comprehensive guide will show you how to use built-in methods and functions to easily calculate and display the date.

Let’s get started! And don’t miss out on these effective solutions for the JavaScript date tomorrow!

What is date object in JavaScript?

The date object represents a particular point in time and offers several functions for handling dates and times.

By utilizing these functions, we can effortlessly access and modify various parts of a date, such as a day, month, year, and other details.

How to get the tomorrow’s date in JavaScript?

Here are the different solutions you can use to get the JavaScript date tomorrow.

Solution 1: Use the date object

To easily get tomorrow’s date in JavaScript, one of the easiest and simplest methods is by utilizing the Date object.

This object offers various methods that make date manipulation effortless.

By creating a new Date object and increasing the day value by 1 using the setDate() method, we can obtain tomorrow’s date.

Here’s an example:

const today = new Date();
const tomorrow = new Date();
tomorrow.setDate(today.getDate() + 1);

console.log(tomorrow);

Output:

2023-06-30T01:50:38.315Z

Solution 2: Use setdate method

In this solution, we start by creating a new Date object for today’s date.

Then, we use the setDate() method to set the date to tomorrow by adding one day.

This method adjusts the day of the month based on the current local time.

In this example code below, we wanted to show you how to get the date today and the date tomorrow in JavaScript.

const today = new Date();

console.log("Today's Date -", today);

let tomorrow = new Date();
tomorrow.setDate(today.getDate() + 1);

console.log("Tomorrow's Date -", tomorrow);

Output:

Today's Date - 2023-06-29T01:04:53.626Z
Tomorrow's Date - 2023-06-30T01:04:53.631Z

Solution 3: Moment.js Library

Here, we use the Moment.js library to create a new moment object for today’s date.

Then, we add one day to it using the add() method.

const moment = require('moment');
const date = moment(new Date());
date.add(1, 'days');
console.log(date.format('YYYY/MM/DD'));

Finally, we format the date in the desired format using the format() method.

Output:

2023/06/30

You can also use the following format of code:

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

console.log(tomorrow.format('YYYY-MM-DD'));

Output:

2023-06-30

Solution 4: getTime() method

This solution started by creating a new Date object for today’s date. Then use the getTime() method to get the number of milliseconds that have passed.

By adding the total number of milliseconds in one day (24 hours * 60 minutes * 60 seconds * 1000 milliseconds), we calculate the time for tomorrow.

var today = new Date();
var tomorrow = new Date(today.getTime() + (24 * 60 * 60 * 1000));
console.log(tomorrow.toDateString());

Finally, we create a new Date object using this calculated time.

Output:

Fri Jun 30 2023

How to get tomorrow’s date in JavaScript in format dd-mm-yy

If you wanted to get the dd-mm-yy format, you can use the following code. Aside from that, we also discuss some of the dd-mm-yy formats above, which you can also use.

var currentDate = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
var day = currentDate.getDate()
var month = currentDate.getMonth() + 1
var year = currentDate.getFullYear()
document.write("<b>" + day + "/" + month + "/" + year + "</b>")

When the example code above won’t run in your case, this is the reason.

The document object is used to change the content of a web page.

If you’re running this code in an environment without access to the document object, like a Node.js script or a JavaScript console outside of a web page, you won’t be able to use it.

In that case, you can use console.log() to display the output in a Node.js script.

For example:

var currentDate = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
var day = currentDate.getDate()
var month = currentDate.getMonth() + 1
var year = currentDate.getFullYear()
console.log(day + "/" + month + "/" + year)

This code figures out the date for tomorrow and shows it in the format day/month/year.

Output:

30/6/2023

The Cleanest One-Liner

const tomorrow = new Date(Date.now() + 86_400_000);
console.log(tomorrow);

This adds exactly 86,400,000 milliseconds (24 hours) to the current time. It is the shortest possible answer, but watch out: it adds 24 EXACT hours, not 1 calendar day. Across daylight saving time (DST) transitions, you may end up on the wrong day at 23:00 or 01:00 local time.

The DST-Safe Calendar-Day Method

function getTomorrow() {
    const t = new Date();
    t.setDate(t.getDate() + 1);
    return t;
}

console.log(getTomorrow());

setDate() increments the calendar day in local time, so it correctly handles DST. If today is March 9 at 11:00 PM (before DST starts) and you call this, you get March 10 at 11:00 PM — the same time of day, the next calendar date. The +86400000 approach would give March 11 at midnight instead.

Formatting the Date for Display

const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);

// ISO format (good for storing, sorting, sending to APIs)
console.log(tomorrow.toISOString().slice(0, 10));
// → "2026-05-13"

// Locale format (good for displaying to users)
console.log(tomorrow.toLocaleDateString("en-PH"));
// → "5/13/2026"

console.log(tomorrow.toLocaleDateString("en-US", {
    weekday: "long",
    year:    "numeric",
    month:   "long",
    day:     "numeric"
}));
// → "Wednesday, May 13, 2026"

Setting Tomorrow’s Date as an Input Min Value

A common real-world use: a date-picker input for booking forms where you cannot pick today or earlier. Set the input’s min attribute to tomorrow:

const input = document.querySelector('input[type="date"]');
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
input.min = tomorrow.toISOString().slice(0, 10);

The browser now disables every date up to and including today. The user can only pick tomorrow or later. Works in all modern browsers.

Common Mistakes Getting Tomorrow’s Date

  • Adding 24 hours (86400000 ms) and assuming it always lands on tomorrow. Across DST transitions this lands on today or the day after. Use setDate() for calendar-day accuracy.
  • Forgetting that setDate() mutates the original Date. If you pass a Date to a function and call setDate(), the caller’s Date is also modified. Clone first: new Date(originalDate).
  • Using Date.now() + 86400000 and getting a string instead of a Date. Date.now() returns milliseconds (a number), not a Date. Wrap in new Date(...) if you want Date methods.
  • Forgetting timezone differences. The user’s “tomorrow” depends on their local time. A server in UTC may compute a different tomorrow than a user in Manila. Compute on the client unless you have a specific reason not to.
  • Hardcoding the format. "2026-05-13" works for ISO but US users expect "5/13/2026". Use toLocaleDateString() with the user’s locale.

Conclusion

In this article, we discover how to get tomorrow’s date in JavaScript using various methods.

The solutions include using the Date object’s setDate() method, the Moment.js library, and the getTime() method. Each method offers a straightforward way to calculate tomorrow’s date.

By following these solutions, you can easily enhance your web applications and create dynamic experiences for users.

Moreover, this article also provides a code snippet for obtaining tomorrow’s date in the format dd-mm-yy, with considerations for scenarios where the document object may not be accessible.

We are hoping that this article provides you with enough information that helps you understand the JavaScript date tomorrow.

Frequently Asked Questions

What is the easiest way to get tomorrow’s date in JavaScript?

The cleanest one-liner is new Date(Date.now() + 86_400_000) which adds 24 hours to the current time. For DST-safe calendar-day accuracy, use const t = new Date(); t.setDate(t.getDate() + 1); instead. The setDate approach is safer for booking forms and scheduling because it handles daylight saving correctly.

Why does adding 86400000 ms not always give tomorrow’s date?

Across DST transitions (when clocks spring forward or fall back), a “day” is actually 23 or 25 hours, not exactly 24. Adding 24 hours of milliseconds at 11:00 PM the night before DST ends puts you at midnight the day AFTER tomorrow, not tomorrow. The fix is using setDate(getDate() + 1) which works at the calendar-day level.

How do I format tomorrow’s date as YYYY-MM-DD?

Use toISOString() and slice the date portion: tomorrow.toISOString().slice(0, 10). This returns “2026-05-13” format which is standard ISO 8601, perfect for HTML date inputs, database storage, and API calls. The toISOString output is always in UTC, so subtract the timezone offset first if you need local-time formatting.

Does setDate() change the original Date object?

Yes — setDate() mutates the Date in place AND returns a millisecond timestamp (not the Date itself). This is a common bug source: if you pass a Date to a function and call setDate(), the original variable also changes. Always clone first: const tomorrow = new Date(today); tomorrow.setDate(tomorrow.getDate() + 1);

How do I get tomorrow’s date in a specific timezone?

Use the Intl.DateTimeFormat API with the timeZone option: new Intl.DateTimeFormat("en-US", { timeZone: "Asia/Manila", year: "numeric", month: "2-digit", day: "2-digit" }).format(tomorrow). This returns the date as it would appear in Manila regardless of where the user’s browser is. For complex timezone math, the date-fns-tz library makes it easier.

Related JavaScript Tutorials

Thank you for reading itsourcecoders 😊.

Leave a Comment