Categories
JavaScript Answers

How to get current date with Moment and JavaScript?

Spread the love

Sometimes, we want to get current date with Moment and JavaScript.

In this article, we’ll look at how to get current date with Moment and JavaScript.

How to get current date with Moment and JavaScript?

To get current date with Moment and JavaScript, we use the moment function without any arguments.

For instance, we write

const datetime = moment();

to call moment to get a moment object with the current date.

Conclusion

To get current date with Moment and JavaScript, we use the moment function without any arguments.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *