原文来自:https://momentjs.com/docs/#/parsing/
Day.js、momentjs、luxon、date-fns、js-Joda,链接在下面。
下图是网页翻译
Moment.js
A JavaScript date library for parsing, validating, manipulating, and formatting dates.
Project Status
Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library.
For more details and recommendations, please see Project Status in the docs.
Thank you.
以下四个是Moment.js推荐的备选方案
Luxon
Luxon can be thought of as the evolution of Moment. It is authored by Isaac Cambron, a long-time contributor to Moment. Please read Why does Luxon exist? and the For Moment users pages in the Luxon documentation.
- Locales:
Intl
provided - Time Zones:
Intl
provided
Day.js
Day.js is designed to be a minimalist replacement for Moment.js, using a similar API. It is not a drop-in replacement, but if you are used to using Moment's API and want to get moving quickly, consider using Day.js.
- Locales: Custom data files that can be individually imported
- Time Zones:
Intl
provided, via a plugin
date-fns
Date-fns offers a series of functions for manipulating JavaScript Date
objects. For more details, scroll to "Why date-fns?" on the date-fns home page.
- Locales: Custom data files that can be individually imported
- Time Zones:
Intl
provided, via a separate companion library
js-Joda
js-Joda is a JavaScript port of Java's Three-Ten Backport, which is the base for JSR-310 implementation of the Java SE 8 java.time
package. If you are familiar with java.time
, Joda-Time, or Noda Time, you will find js-Joda comparable.
- Locales: Custom data files via add-on module
- Time Zones: Custom data files via add-on module