DEV Community

loading...

The Temporal Date API

Siddharth
13. Coding for a hobby
・1 min read

Have you heard of Temporal? It's an ECMAScript proposal currently at stage 3. It 'brings a modern date/time API to the ECMAScript language':

Date has been a long-standing pain point in ECMAScript. This proposes Temporal, a global Object that acts as a top-level namespace (like Math), that brings a modern date/time API to the ECMAScript language. For a detailed breakdown of motivations, see: Fixing JavaScript Date

Temporal fixes these problems by:

  • Providing easy-to-use APIs for date and time computations
  • First-class support for all time zones, including DST-safe arithmetic
  • Dealing only with objects representing fixed dates and times
  • Parsing a strictly specified string format
  • Supporting non-Gregorian calendars

The whole documentation is here. It seems like a very interesting proposal and this might make libraries like Moment irrelevant.

Discussion (0)