One of the most common and feared tasks in programming is working with dates and time. The way dates are normally stored in databases or provided by 3rd party APIs is very different from the way you’d like to display them to your users. Moreover, if you have to make calculations such as scheduling dates in the future (e.g. send this email two weeks from now) or displaying relative time (e.g. this happened 2 minutes ago) things start to get tricky. And let’s get it out of the way early: to say that JavaScript’sDateAPIisquirky is to be kind with it. That’s whereMoment.jscomes in to the rescue!