"How many days until 24 December?" sounds like a one-liner. In JavaScript it's a small trap with three jaws: time zones, daylight saving time and the way Date parses strings. I ran into all three while building a countdown app, so here's what goes wrong and the small set of helpers I ended up trusting. All snippets below were run in Node 20. The Temporal one uses the @js-temporal/polyfill package. Pitfall 1: a day is not always 86,400,000 ms The classic approach: ...