Skip to main content

How long is a second in JavaScript?

· 7 min read
Iago Lastra
Cofounder | TimeTime.in

When you ask the question "How long is a second in JavaScript?", it seems like a straightforward query. However, the answer reveals layers of complexity intertwined with history, science, and the foundations of modern computing. Let’s dive deep to understand how humanity has measured time and how it connects to JavaScript’s timekeeping.

Time duration in JS

· 9 min read
Iago Lastra
Cofounder | TimeTime.in

When working with time, developers often assume that each minute, hour, and day behaves predictably, but the real world is much more complex. Factors like leap seconds, Daylight Saving Time (DST), and time zones can introduce unexpected behaviors in time calculations. JavaScript’s traditional Date API struggles to handle these nuances, but the Temporal API provides a robust, modern solution. This guide focuses on one key aspect of the Temporal API: Durations.

JS Dates Are About to Be Fixed

· 10 min read
Iago Lastra
Cofounder | TimeTime.in

The problem

Of all the recent changes coming to ECMAScript, my favorite by far is the Temporal proposal. This proposal is very advanced, and we can already use this API through the polyfill provided by the FullCalendar team.

This API is so incredible that I will likely dedicate several blog posts to highlighting its key features. However, in this first post, I will focus on explaining one of its main advantages: we finally have a native object to represent a "Zoned Date Time".

But... What is a "Zoned Date Time"?