momentjs.com Open in urlscan Pro
2606:4700::6811:5d26  Public Scan

URL: https://momentjs.com/
Submission: On September 04 via api from GB — Scanned from GB

Form analysis 0 forms found in the DOM

Text Content

Moment Moment
Timezone Luxon
Home Docs Guides Tests GitHub
Moment.js 2.29.4
Parse, validate, manipulate,
and display dates and times in JavaScript.
Considering using Moment in your project?
There may be better modern alternatives.
For more details and recommendations,
please see Project Status in the docs.


BLACK LIVES MATTER


IT IS NOT OUR DIFFERENCES THAT DIVIDE US. IT IS OUR INABILITY TO RECOGNIZE,
ACCEPT, AND CELEBRATE THOSE DIFFERENCES. - AUDRE LORDE


DONATE | WIKIPEDIA | READ | WATCH | GET INVOLVED


DOWNLOAD

moment.js moment.min.js 18.1k moment-with-locales.js moment-with-locales.min.js
73k


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'); // September 4th 2023, 5:34:27 pm
moment().format('dddd');                    // Monday
moment().format("MMM Do YY");               // Sep 4th 23
moment().format('YYYY [escaped] YYYY');     // 2023 escaped 2023
moment().format();                          // 2023-09-04T17:34:27+01:00


RELATIVE TIME

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


CALENDAR TIME

moment().subtract(10, 'days').calendar(); // 08/25/2023
moment().subtract(6, 'days').calendar();  // Last Tuesday at 5:34 PM
moment().subtract(3, 'days').calendar();  // Last Friday at 5:34 PM
moment().subtract(1, 'days').calendar();  // Yesterday at 5:34 PM
moment().calendar();                      // Today at 5:34 PM
moment().add(1, 'days').calendar();       // Tomorrow at 5:34 PM
moment().add(3, 'days').calendar();       // Thursday at 5:34 PM
moment().add(10, 'days').calendar();      // 09/14/2023


MULTIPLE LOCALE SUPPORT

moment.locale();         // en
moment().format('LT');   // 5:34 PM
moment().format('LTS');  // 5:34:27 PM
moment().format('L');    // 09/04/2023
moment().format('l');    // 9/4/2023
moment().format('LL');   // September 4, 2023
moment().format('ll');   // Sep 4, 2023
moment().format('LLL');  // September 4, 2023 5:34 PM
moment().format('lll');  // Sep 4, 2023 5:34 PM
moment().format('LLLL'); // Monday, September 4, 2023 5:34 PM
moment().format('llll'); // Mon, Sep 4, 2023 5:34 PM

Afrikaans
Albanian
Arabic
Arabic (Algeria)
Arabic (Kuwait)
Arabic (Libya)
Arabic (Morocco)
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
Malay
Malayalam
Maldivian
Maltese (Malta)
Maori
Marathi
Mongolian
Montenegrin
Nepalese
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


DONATE

Some Moment.js users may have a little extra money. Please support these
charities:


BLACK LIVES MATTER FOUNDATION


EQUAL JUSTICE INITIATIVE


INNOCENCE PROJECT


THE LEADERSHIP CONFERENCE


MINNESOTA FREEDOM FUND


NAACP LEGAL DEFENSE & EDUCATION FUND


HUMAN RIGHTS WATCH

Here is a list of related organizations you can support.

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