格式化日期
moment().format('MMMM Do YYYY, h:mm:ss a');
moment().format('dddd');
moment().format("MMM Do YY");
moment().format('YYYY [escaped] YYYY');
moment().format();
相对时间
moment("20111031", "YYYYMMDD").fromNow();
moment("20120620", "YYYYMMDD").fromNow();
moment().startOf('day').fromNow();
moment().endOf('day').fromNow();
moment().startOf('hour').fromNow();
日历时间
moment().subtract(10, 'days').calendar();
moment().subtract(6, 'days').calendar();
moment().subtract(3, 'days').calendar();
moment().subtract(1, 'days').calendar();
moment().calendar();
moment().add(1, 'days').calendar();
moment().add(3, 'days').calendar();
moment().add(10, 'days').calendar();
多语言环境支持
moment.locale();
moment().format('LT');
moment().format('LTS');
moment().format('L');
moment().format('l');
moment().format('LL');
moment().format('ll');
moment().format('LLL');
moment().format('lll');
moment().format('LLLL');
moment().format('llll');
Afrikaans
Albanian
Arabic
Arabic (Algeria)
Arabic (Kuwait)
Arabic (Libya)
Arabic (Morocco)
Arabic (Palestine)
Arabic (Saudi Arabia)
Arabic (Tunisia)
Armenian
Azerbaijani
Bambara
Basque
Belarusian
Bengali
Bengali (Bangladesh)
Bosnian
Breton
Bulgarian
Burmese
Cambodian
Catalan
Central Atlas Tamazight
Central Atlas Tamazight Latin
Chinese (China)
Chinese (Hong Kong)
Chinese (Macau)
Chinese (Taiwan)
Chuvash
Croatian
Czech
Danish
Dutch
Dutch (Belgium)
English (Australia)
English (Canada)
English (India)
English (Ireland)
English (Israel)
English (New Zealand)
English (Singapore)
English (United Kingdom)
English (United States)
Esperanto
Estonian
Faroese
Filipino
Finnish
French
French (Canada)
French (Switzerland)
Frisian
Galician
Georgian
German
German (Austria)
German (Switzerland)
Greek
Gujarati
Hebrew
Hindi
Hungarian
Icelandic
Indonesian
Irish or Irish Gaelic
Italian
Italian (Switzerland)
Japanese
Javanese
Kannada
Kazakh
Klingon
Konkani Devanagari script
Konkani Latin script
Korean
Kurdish
Kyrgyz
Lao
Latvian
Lithuanian
Luxembourgish
Macedonian
Malay
Malayalam
Maldivian
Maltese (Malta)
Maori
Marathi
Mongolian
Montenegrin
Nepalese
Northern Kurdish
Northern Sami
Norwegian Bokmål
Nynorsk
Occitan, lengadocian dialecte
Persian
Polish
Portuguese
Portuguese (Brazil)
Pseudo
Punjabi (India)
Romanian
Russian
Scottish Gaelic
Serbian
Serbian Cyrillic
Sindhi
Sinhalese
Slovak
Slovenian
Spanish
Spanish (Dominican Republic)
Spanish (Mexico)
Spanish (United States)
Swahili
Swedish
Tagalog (Philippines)
Tajik
Talossan
Tamil
Telugu
Tetun Dili (East Timor)
Thai
Tibetan
Turkish
Turkmen
Ukrainian
Urdu
Uyghur (China)
Uzbek
Uzbek Latin
Vietnamese
Welsh
Yoruba Nigeria
siSwati