Temporal, JavaScript's new date and time API, reached TC39 Stage 4 in March 2026 and is already shipping in Chrome 144 and Firefox 139. It replaces Moment.js, which entered maintenance mode in 2020, and patches the broken Date API that has shipped with JavaScript since the beginning. A polyfill covers Node.js and older browsers in the meantime.

The case against Moment is specific: no tree shaking means the full library ships regardless of how little you use, its objects are mutable by default causing silent bugs, and months are zero-indexed so January is 0. Temporal fixes all three. Objects are immutable, months are 1-based, time zones are built in without a separate package, and because it lives in the browser itself it adds zero bytes to your bundle.

The full article is worth reading for the migration recipes. It shows side-by-side code for creating instants, converting time zones, and using Temporal.PlainDate and Temporal.PlainTime, the types that have no equivalent in Moment. The mutation trap in moment.utc(), where calling the method silently rewrites the original object, is demonstrated with a concrete example that explains a category of bugs many developers have shipped without realizing it.

[READ ORIGINAL →]