Get the latest tech news

JavaScript Temporal is coming


A new way to handle dates and times is being added to JavaScript. Let's take a look at Temporal, what problems it solves, the current state, and what you'll find in the new documentation about it on MDN.

Some of the most basic usages of Temporal include getting current dates and times as an ISO string, but we can see from the example below, that we can now provide time zones with many methods, which takes care of complex calculations you may be doing yourself: Working with Unix timestamps is a very common use case as many systems (APIs, databases) use the format to represent times. There's a lot to highlight, but one pattern that I thought was interesting in the API is the compare() methods, which allow you to in an elegant and efficient way:

Get the Android app

Or read this on Hacker News

Read more on:

Photo of JavaScript Temporal

JavaScript Temporal