Sometimes, we want to get the current date in an app with Node.js
In this article, we’ll look at how to get the current date in an app with Node.js.
How to get the current date in an app with Node.js?
To get the current date in an app with Node.js, we can use the Date constructor with no arguments.
For instance, we write
const datetime = new Date();
console.log(datetime);
to create a Date instance with the current datetime value.
And then we log the datetime.
Conclusion
To get the current date in an app with Node.js, we can use the Date constructor with no arguments.