JavaScript Temporal API — A Fix for the Date API

Anyone who has worked with dates and time in JavaScript knows how broken the built-in Date is. In the near future we’ll be able to use Temporal instead, an ECMAScript feature currently at Stage-3 Nathan Sebhastian has a good overview on how it compares to Date, along with some practical examples. The new Temporal API …


This content originally appeared on Bram.us and was authored by Bramus!

Anyone who has worked with dates and time in JavaScript knows how broken the built-in Date is. In the near future we’ll be able to use Temporal instead, an ECMAScript feature currently at Stage-3

?‍♂️ Stage-3?

The Technical Committee which is concerned with the standardization of ECMAScript (e.g. TC39) has a 5 stage process in place, ranging from stage-0 to stage-4, by which it develops a new language feature.

Stage-3 is the Candidate Stage where the feature is considered complete and only critical changes will happen based on implementation experience. If all goes well the proposal will advance to Stage 4 without any changes, after which it will to become part of the ECMAScript Specification.

Nathan Sebhastian has a good overview on how it compares to Date, along with some practical examples.

The new Temporal API proposal is designed to solve the problems with the Date API. It brings the following fixes to JavaScript date/time manipulation:

  • Creating and dealing only with immutable Temporal objects
  • Straightforward API for date and time computations
  • Support for all timezones
  • Strict date parsing from ISO-8601 format
  • Support for non-Gregorian calendars

JavaScript Temporal API — A Fix for the Date API →


This content originally appeared on Bram.us and was authored by Bramus!


Print Share Comment Cite Upload Translate Updates
APA

Bramus! | Sciencx (2021-04-14T21:57:25+00:00) JavaScript Temporal API — A Fix for the Date API. Retrieved from https://www.scien.cx/2021/04/14/javascript-temporal-api-a-fix-for-the-date-api-2/

MLA
" » JavaScript Temporal API — A Fix for the Date API." Bramus! | Sciencx - Wednesday April 14, 2021, https://www.scien.cx/2021/04/14/javascript-temporal-api-a-fix-for-the-date-api-2/
HARVARD
Bramus! | Sciencx Wednesday April 14, 2021 » JavaScript Temporal API — A Fix for the Date API., viewed ,<https://www.scien.cx/2021/04/14/javascript-temporal-api-a-fix-for-the-date-api-2/>
VANCOUVER
Bramus! | Sciencx - » JavaScript Temporal API — A Fix for the Date API. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/14/javascript-temporal-api-a-fix-for-the-date-api-2/
CHICAGO
" » JavaScript Temporal API — A Fix for the Date API." Bramus! | Sciencx - Accessed . https://www.scien.cx/2021/04/14/javascript-temporal-api-a-fix-for-the-date-api-2/
IEEE
" » JavaScript Temporal API — A Fix for the Date API." Bramus! | Sciencx [Online]. Available: https://www.scien.cx/2021/04/14/javascript-temporal-api-a-fix-for-the-date-api-2/. [Accessed: ]
rf:citation
» JavaScript Temporal API — A Fix for the Date API | Bramus! | Sciencx | https://www.scien.cx/2021/04/14/javascript-temporal-api-a-fix-for-the-date-api-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.