Categories
JavaScript Answers

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

Spread the love

Sometimes, we want to get tomorrow’s date in format dd-mm-yy with JavaScript.

In this article, we’ll look at how to get tomorrow’s date in format dd-mm-yy with JavaScript.

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

To get tomorrow’s date in format dd-mm-yy with JavaScript, we can use the date instance’s toLocaleDateString method.

For instance, we write

const d = new Date(2022, 1, 29);
console.log(d.toLocaleDateString());

to create date d with the Date constructor.

Then we call toLocaleDateString to return a human readable date string.

Conclusion

To get tomorrow’s date in format dd-mm-yy with JavaScript, we can use the date instance’s toLocaleDateString method.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.