Moment.js - The Missing Javascript Date Library

Written by Kevin Liew on 17 Feb 2012
34,295 Views • Javascript

moment.js is a lightweight and robust javascript date library for parsing, manipulating and formatting dates. Current javascript date method is just too basic to fulfil slightly complex date manipulation such as differences between dates, convert Unixtime stamp, date display customization. Also, you can easily achieve twitter's style relative time display (eg, posted 3 minutes ago).

If you know about PHP date function, moment.js basically take it as a reference therefore, you will get some familiar feature in this javascript. It's well-documented and its documentation will able to help you to use every single configurations and methods available in moment.js.


  • Lightweight, only 3.2kb
  • No dependencies, standalone javascript
  • Date Parsing: supports Unix timstamp, String, Date with specific format.
  • Date Manipulation: Add, subtract dates
  • Date Display: Robust date display option including relative time display.
  • Other built-in methods such as daylight saving, leap year, timezone offset and i18n language customization.
  • it also works as a NodeJS module
  • Documentation.



Join the discussion

Comments will be moderated and rel="nofollow" will be added to all links. You can wrap your coding with [code][/code] to make use of built-in syntax highlighter.

1 comment
Arun Mahendrakar 12 years ago
Just one thing tho.. Halloween is on the last day of Oct not Sept. (sorry to be picky). I'm sure to look into this libraby!