moment /moment

Parse, validate, manipulate, and display dates in javascript.

★ 47,871⑂ 6,978👁 815⑃ 2,195● 4,166▤ 2◈ 23
JavaScriptMITCreated 2011-03-01momentjs.com
TA的项目
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

Discussions

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

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON