Daylight Saving Time Issues: Common DST Bugs and How to Avoid Them
Identify and fix daylight saving time bugs in software. Covers repeated hours, skipped hours, scheduling failures, and database timestamp traps.
Published:
Tags: developer-tools, timestamps, dst
Daylight Saving Time Issues: Common DST Bugs and How to Avoid Them Daylight saving time produces some of the most surprising bugs in software. The transitions are infrequent enough that you may not notice a bug until it hits a user at 2 AM, and the symptoms are often subtle — one record off, a cron job running twice, a scheduled task that never fires. This article documents the bugs DST causes and how to structure your code to avoid them. Bug 1: The Repeated Hour On the night clocks fall back, any event scheduled between 1:00 AM and 1:59 AM local time occurs twice. If this job sends invoices, does reconciliation, or fires webhooks, it runs twice. Users see duplicate emails. Transactions get double-processed. Fix: Schedule in UTC. 1:30 AM Eastern is UTC-4 in summer and UTC-5 in winter.…
All articles · theproductguy.in