"Moment.js has been successfully used in millions of projects, and we are happy to have contributed to making date and time better on the web. As of September 2020, Moment gets over 12 million downloads per week!
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
Locales: Custom data files via add-on module
Time Zones: Custom data files via add-on module
When using Date objects, be aware of the following:
The Date object internally represents a Unix timestamp with millisecond precision. It offers functions that will convert to and from the system's local time zone, but it is always UTC internally. Unlike a Moment object, it can not be set to use another time zone; It has no concept of "mode".
Using Date.parse, or new Date(<string>) has been problematic and implemented inconsistently in the past. The current specification defines parsing a variation of ISO 8601 strings, where date-only forms (like "2020-09-14") are parsed as UTC, instead of local time as they would be by ISO 8601. Even then, not all modern implementations have implemented this specification correctly (e.g., Safari). Other types of strings may work, but parsing them is implementation specific and can vary significantly - especially with older browsers. Depending on the implementation, and the components provided in the string, you may be surprised with the result. For these reasons, we agree with MDN's statement that parsing strings with the Date object is strongly discouraged.
When using the Intl object, be aware of the following:
Not every environment will implement the full specification. In particular, Node.js environments require internationalization support provided by ICU. See the Node.js documentation for further details.
Most newer environments provide IANA time zone support via the timeZone option in the Intl.DateTimeFormat constructor (and in Date.toLocaleString, Date.toLocaleDateString, and Date.toLocaleTimeString). This option can be used to take the internal UTC-based timestamp of a Date object and get a string that has been converted to a named time zone. However, it can not be used to convert a Date object to a different time zone.
If the Date and Intl objects meet your needs and you fully understand their limitations, then you might consider using them directly.