Date manipulation is incredibly common in most applications. It is one of those development hurdles that we all must deal with at some point in our career. We have several tools for manipulating Dates in JavaScript. Moment.js is one of those tools for JavaScript development.

It makes dates and times easy to format, parse, validate, and internationalize. The standard JavaScript Date object isn’t too bad; it just requires writing a lot of code to do complex parsing, validation, and displaying of dates.

To begin with, link the library from cdnjs in your HTML. If you are using NodeJS, you can do “npm install moment --save.” Let’s look at some examples to get a glimpse of Moment.js.

Conclusion

Moment.js is a great library to have if you are often working on dates in JavaScript. We have covered just some basics in this article. It has plenty of other cool features to offer. Check out their documentation and source code on GitHub.