The Manipulate section in Moment

To take a quick peek at some other things Moment can do, let's head back into the docs and go to the Manipulate section:

The first two methods defined under Manipulate are add and subtract. This lets you easily add and subtract time. We can call add adding seven days and we can call subtract subtracting seven months as shown in this example:

To this example, you can get a quick idea about what you can add and subtract, years, quarters, months, weeks, pretty much any unit of time can be added or subtracted:

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.