Join the chat at

NPM version NPM downloads MIT License Build Status Coverage Status

A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.


Port to ECMAScript 6 (version 2.10.0)

Moment 2.10.0 does not bring any new features, but the code is now written in ECMAScript 6 modules and placed inside src/. Previously moment.js, locale/*.js and test/moment/*.js, test/locale/*.js contained the source of the project. Now the source is in src/, temporary build (ECMAScript 5) files are placed under build/umd/ (for running tests during development), and the moment.js and locale/*.js files are updated only on release.

If you want to use a particular revision of the code, make sure to run grunt transpile update-index, so moment.js and locales/*.js are synced with src/*. We might place that in a commit hook in the future.

Upgrading to 2.0.0

There are a number of small backwards incompatible changes with version 2.0.0. See the full descriptions here

  • Changed language ordinal method to return the number + ordinal instead of just the ordinal.

  • Changed two digit year parsing cutoff to match strptime.

  • Removed moment#sod and moment#eod in favor of moment#startOf and moment#endOf.

  • Removed moment.humanizeDuration() in favor of moment.duration().humanize().

  • Removed the lang data objects from the top level namespace.

  • Duplicate Date passed to moment() instead of referencing it.



We're looking for co-maintainers! If you want to become a master of time please write to ichernev.


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

NPM版本 NPM下载 建立状态 覆盖状态



端口到ECMAScript 6(版本2.10.0)

时刻2.10.0不带任何新功能,但代码现在写入 ECMAScript 6模块并放置在 src / 中。以前的 moment.js locale / *。js test / moment / *。js test / locale / *。js 包含项目的源代码。现在 源代码在 src / 中,临时构建(ECMAScript 5)文件放在下面 build / umd / (用于在开发期间运行测试)和 moment.js locale / * .js 文件仅在发布时才更新。

如果要使用代码的特定版本,请确保运行 grunt transpile update-index ,所以 moment.js locales / *。js 同步 与 src / * 。我们可能会把它放在一个提交钩子中。

升级到2.0 .0

版本2.0.0有许多小的向后不兼容的更改。 请参阅这里的完整说明

  • 更改语言序数方法以返回数字+序数而不是序数。

  • 更改两位数年份解析截止字符以匹配strptime。

  • 删除时刻#sod moment#eod ,支持 moment#startOf moment#endOf

  • 删除 moment.humanizeDuration(),支持 moment.duration()。humanize()

  • 从顶层命名空间中删除lang数据对象。

  • 将重复的日期传递给 moment(),而不是引用它。



我们正在寻找共同维护者!如果你想成为时间的主人,请 写入 ichernev