Moment.js

A lightweight (4.3k) javascript date library for parsing, manipulating, and formatting dates.

Get the current version 1.6.2

npm install moment

Production (4.3k min & gzip)

Development (full 31.2k source)

Formatting dates

moment().format('dddd, MMMM Do YYYY, h:mm:ss a');

moment().format('dddd [on the] wo [week of the year]');
moment().format("MMM Do 'YY");
moment().format(); // defaults to ISO-8601

Timeago

moment("2011-10-31", "YYYY-MM-DD").fromNow();

Calendar Time

moment().subtract('days', 3).calendar();

Internationalization

moment.lang('fr');

moment().format('LLLL');