Moment.js2.6.0

A 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
Breton
Bosnian
Catalan
Czech
Chuvash
Welsh
Danish
German
Greek
English
English (Australia)
English (Canada)
English (England)
Esperanto
Spanish
Estonian
Basque
Persian
Finnish
Farose
French
French (Canada)
Galician
Hebrew
Hindi
Croatian
Hungarian
Armenian
Bahasa Indonesia
Icelandic
Italian
Japanese
Georgian
Khmer (Cambodia)
Korean
Lithuanian
Latvian
Malayalam
Marathi
Bahasa Malaysian
Norwegian
Nepalese
Dutch
Norwegian Nynorsk
Polish
Portuguese
Portuguese (Brazil)
Romanian
Russian
Slovak
Slovenian
Albanian
Serbian
Serbian Cyrillic
Swedish
Thai
Tagalog (Filipino)
Turkish
Tamaziɣt
Ukrainian
Uzbek
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('l');
moment().format('LL');
moment().format('ll');
moment().format('LLL');
moment().format('lll');
moment().format('LLLL');
moment().format('llll');