47,871
stars
+0
6,978
forks
815
watchers
2,195
prs
4,166
issues
2
releases
23
discussions
README
Moment.js
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-downloads-url]
[![MIT License][license-image]][license-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![FOSSA Status][fossa-badge-image]][fossa-badge-url]
A JavaScript date library for parsing, validating, manipulating, and formatting
dates.
⚠️ Moment.js is a legacy project, now in maintenance mode. New features
are not being accepted. For more details, see the
latest project status update.
_Thank you._
Moment.js is a project of the OpenJS Foundation, which
is part of the Linux Foundation.
Resources
- Documentation
- Changelog
- Stack Overflow
- Security Policy
- Threat Model
Installation
Install Moment.js using a package manager like npm, yarn, or bun.
bash
npm install moment
License
Moment.js is an OpenJS Foundation project and is freely distributable under the
terms of the [MIT license][license-url].
Copyright OpenJS Foundation and Moment.js contributors.
All rights reserved. The OpenJS Foundation has registered
trademarks and uses trademarks. For a list of trademarks of the
OpenJS Foundation, please see our
Trademark Policy and
Trademark List. Trademarks and logos not
indicated on the
list of OpenJS Foundation trademarks are
trademarks™ or registered® trademarks of their respective holders. Use
of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation |
[AI Coding Assistants Policy][ai-policy] |
Bylaws |
Code of Conduct |
Cookie Policy |
Privacy Policy |
Terms of Use |
Trademark List |
Trademark Policy
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: LICENSE
[npm-url]: https://npmjs.org/package/moment
[npm-version-image]: https://img.shields.io/npm/v/moment.svg?style=flat
[npm-downloads-image]: https://img.shields.io/npm/dm/moment.svg?style=flat
[npm-downloads-url]: https://npmcharts.com/compare/moment?minimal=true
[coveralls-image]: https://coveralls.io/repos/moment/moment/badge.svg?branch=develop
[coveralls-url]: https://coveralls.io/r/moment/moment?branch=develop
[fossa-badge-image]: https://app.fossa.io/api/projects/custom%2B20126%2Fgithub.com%2Fmoment%2Fmoment.svg?type=shield
[fossa-badge-url]: https://app.fossa.io/projects/custom%2B20126%2Fgithub.com%2Fmoment%2Fmoment?ref=badge_shield
[ai-policy]: https://ai-coding-assistants-policy.openjsf.org/Top issues
#5786Please fix Russian locale months abbreviations10 comments · 2020-12-02#2659Investigate performance tuning of moment creation and comparison10 comments · 2015-10-08#5698Support Short Japanese Era Name7 comments · 2020-08-26#5600moment giving wrong month 6 comments · 2020-06-16#5515Different `utcOffset()` result in firefox and chrome6 comments · 2020-05-06#2928Duration days value inconsistent depending on input (years/days)6 comments · 2016-01-28#5512Adjustment for moment locale bs.js5 comments · 2020-05-04#5267moment("2019-08-30 23:59:59").from(moment("2019-10-25 12:00:00")) is '54.50001157407407 days ago' (should be 55.500... days ago)5 comments · 2019-10-24
Discussions
#6373Project Maintenance Status0 comments · 2026-07-26#6411Need an error if parsing format string does not match expected format, instead of giving some default output.2 comments · 2024-12-19#6412how to use meridiemHour? I can't find any info in docs1 comments · 2024-08-22#6413Issue creating basic countdown with special format3 comments · 2024-08-18#6414Moment.js Locale Override Mystery - AM/PM Parsing Gone Wrong!"7 comments · 2024-05-15#6415Time Format without AM and PM3 comments · 2024-03-27#6416Wrong result in date diff in days1 comments · 2024-02-23#6417.weeks() gives 0 for months with daylight saving time time change3 comments · 2023-01-26
Latest release
2.31.0 2.31.0 2026-09-15_Released Sep 14, 2026_
Security fixes
- Fix CVE-2026-17495 (GHSA-4p3w-j4w9-5jqw)
Bug fixes
- 6376 Prevent object prototype properties from being used as format tokens
- 6386 Normalize lazy-loaded locale names
- 6404 Fix parsing issue with eHHmm format
- 6433 Ignore non-Moment arguments in min and max
- 6434 Fix inherited lowercase long date formats
- 6436 Reset locale parsing caches after updates
- 6437 Fix weekday mismatch when the format only has part of a date
- 6442 Fix locale('__proto__') corrupting the global locale
- 6443 Avoid Object.assign in duration.humanize
- 6446 Validate r