momentjs.com Open in urlscan Pro
2606:4700::6810:9919  Public Scan

URL: https://momentjs.com/
Submission: On January 15 via manual from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

Moment Moment
Timezone Luxon
Home Docs Guides Tests GitHub
Considering using Moment in your project?
There may be better modern alternatives.
For more details and recommendations,
please see Project Status in the docs.


MOMENT.JS 2.30.1


PARSE, VALIDATE, MANIPULATE, AND DISPLAY DATES AND TIMES IN JAVASCRIPT.


DOWNLOAD

moment.js moment.min.js 18.4k moment-with-locales.js moment-with-locales.min.js
74.6k


INSTALL

npm install moment --save   # npm
yarn add moment             # Yarn
Install-Package Moment.js   # NuGet
spm install moment --save   # spm
meteor add momentjs:moment  # meteor
bower install moment --save # bower (deprecated)



FORMAT DATES

moment().format('MMMM Do YYYY, h:mm:ss a'); // January 15th 2024, 5:46:06 pm
moment().format('dddd');                    // Monday
moment().format("MMM Do YY");               // Jan 15th 24
moment().format('YYYY [escaped] YYYY');     // 2024 escaped 2024
moment().format();                          // 2024-01-15T17:46:06+01:00


RELATIVE TIME

moment("20111031", "YYYYMMDD").fromNow(); // 12 years ago
moment("20120620", "YYYYMMDD").fromNow(); // 12 years ago
moment().startOf('day').fromNow();        // 18 hours ago
moment().endOf('day').fromNow();          // in 6 hours
moment().startOf('hour').fromNow();       // an hour ago


CALENDAR TIME

moment().subtract(10, 'days').calendar(); // 01/05/2024
moment().subtract(6, 'days').calendar();  // Last Tuesday at 5:46 PM
moment().subtract(3, 'days').calendar();  // Last Friday at 5:46 PM
moment().subtract(1, 'days').calendar();  // Yesterday at 5:46 PM
moment().calendar();                      // Today at 5:46 PM
moment().add(1, 'days').calendar();       // Tomorrow at 5:46 PM
moment().add(3, 'days').calendar();       // Thursday at 5:46 PM
moment().add(10, 'days').calendar();      // 01/25/2024


MULTIPLE LOCALE SUPPORT

moment.locale();         // en
moment().format('LT');   // 5:46 PM
moment().format('LTS');  // 5:46:06 PM
moment().format('L');    // 01/15/2024
moment().format('l');    // 1/15/2024
moment().format('LL');   // January 15, 2024
moment().format('ll');   // Jan 15, 2024
moment().format('LLL');  // January 15, 2024 5:46 PM
moment().format('lll');  // Jan 15, 2024 5:46 PM
moment().format('LLLL'); // Monday, January 15, 2024 5:46 PM
moment().format('llll'); // Mon, Jan 15, 2024 5:46 PM

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

Moment.js is freely distributable under the terms of the MIT license.