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.