Back to browse
GitHub Repository

Experiments in implementing a fast, dependency-free getTimeZonesAt(timestamp)

0 starsTypeScript

easy-tz – A fast, 10KB, dependency-free getTimeZonesAt(timestamp)

by leeoniya·Jul 16, 2026·2 points·0 comments

AI Analysis

●●●●GemWizardryZero to One

10KB replacing 770KB moment-timezone with 80x faster startup is constraint craft at its finest.

Strengths
  • Baked rules approach achieves 1.3% bundle size of moment-timezone without sacrificing accuracy.
  • Solves the Intl abbreviation gap where most zones show generic 'GMT+X' labels.
  • 62 edge-case fixtures passing proves correctness despite aggressive optimization.
Weaknesses
  • Current-year accuracy only means historical timezone transitions aren't supported.
  • Narrow scope limits use cases to modern timezone pickers, not full date libraries.
Target Audience

Frontend developers optimizing bundle size and performance

Similar To

moment-timezone · luxon · date-fns-tz

Post Description

If you have a time zone picker in your web UI that shows accurate & current time zone abbreviations, there's a good chance it's pulling in 770KB of moment-timezone dependency. And if you were thinking of replacing moment with luxon, this use case would be a potential blocker for shrinking your bundle.

It is surprisingly challenging [and soul-sucking] to work with timezone lore with the goal of reducing this down to something small and fast. There are many performance foot-guns and correctness edge-cases that have to be addressed. With the help of AI (Fable 5 here), this becomes tractable for a single engineer to iterate on in the span of a few days. I iterated through about 12 different prototypes during the process, mixing and matching various strategies and approaches for every aspect of the final result. This should tell you something about how much taste and steering still needs to be applied even to frontier models by an experienced engineer to produce something of high production-grade quality, not just, "it works, ship it". If you're familiar with my existing OSS work, I would not ship any level of unaudited slop :) Also, https://github.com/leeoniya/easy-tz/blob/main/comparison.md is not to be missed.

Hopefully one other dev (or agent) finds this useful; I think it fills a missing gap in the frontend timezone-handling ecosystem.

disclaimer: still 0.1.0, so if you use any of the non-default implementations in the lib, expect some turbulence before 1.0.

Similar Projects