How to get Tomorrow's Date with JavaScript

Getting tomorrows date seems like something we might need a library to do for us in JavaScript. However, it is possible to get tomorrows date with vanilla JavaScript.

 

Firstly, create a new Date object.

 

let tomorrow = new Date();

 

Then set a new date on the Date object using the setDate method. Inside the setDate method we will get the date from the Date object and increment it by 1.

 

tomorrow.setDate(tomorrow.getDate() + 1);
console.log(tomorrow);
Fri Aug 28 2020 21:45:58 GMT+0100 (British Summer Time)

 

What's nice about using the above method is JavaScript will handle things like the next day being a new month.