Moment.js2.0.0

A 5.5kb javascript date library for parsing, validating, manipulating, and formatting dates.

Formatting dates

moment().format('MMMM Do YYYY, h:mm:ss a');
moment().format('dddd');
moment().format("MMM Do YY");
moment().format('YYYY [escaped] YYYY');
moment().format();

			

Languages

Arabic
Moroccan Arabic
Bulgarian
Catalan
Czech
Chuvash
Danish
German
English
English (Canada)
English (England)
Esperanto
Spanish
Basque
Finnish
French
French (Canada)
Galician
Hebrew
Hungarian
Bahasa Indonesia
Icelandic
Italian
Japanese
Korean
Latvian
Nepalese
Norwegian
Dutch
Polish
Portuguese
Portuguese (Brazil)
Russian
Slovenian
Swedish
Thai
Turkish
Tamaziɣt
Ukrainian
Chinese
Chinese (Traditional)

Timeago

moment("20111031", "YYYYMMDD").fromNow();
moment("20120620", "YYYYMMDD").fromNow();
moment().startOf('day').fromNow();
moment().endOf('day').fromNow();
moment().startOf('hour').fromNow();

			

Calendar Time

moment().subtract('days', 10).calendar();
moment().subtract('days', 6).calendar();
moment().subtract('days', 3).calendar();
moment().subtract('days', 1).calendar();
moment().calendar();
moment().add('days', 1).calendar();
moment().add('days', 3).calendar();
moment().add('days', 10).calendar();

			

Internationalization

moment().format('L');
moment().format('LL');
moment().format('LLL');
moment().format('LLLL');

			
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.