Cron Jobs and Daylight Saving Time Transitions
Why cron jobs misfire or skip around daylight saving changes, why servers usually run on UTC, how to check cloud time zone settings, and which dates to test.
Scheduler tools like cron, which run jobs at regular intervals on a server, harbor a subtle pitfall when combined with daylight saving time: jobs firing at unintended times, or not firing at all.
The problem of depending on the server's time zone setting
Cron's execution time is usually interpreted according to whatever time zone the server OS is set to. If the server's time zone is set to a region that observes DST (America/New_York, say), a job scheduled for a time that doesn't exist during the spring transition can get skipped entirely, and a job scheduled for the "repeated hour" during the autumn transition can run twice (see also "Real-World Bugs Daylight Saving Time Causes in Computer Systems").
The standard practice of running servers on UTC
A common way to sidestep this risk entirely is to keep the server OS's own time zone set to UTC at all times. If the server operates on UTC, the whole concept of daylight saving time simply doesn't apply, so cron schedules fire at a genuinely consistent interval, every time. A job that should run "every day at 00:00 UTC" and one that should run "every day at 9:00 AM local time in a specific region" are different requirements — the latter needs the application itself to calculate the execution time by applying that region's actual time zone rules.
Checking time zone settings in cloud environments
When using a cloud service's scheduled-execution feature (cron equivalents), always check which time zone the settings screen treats as the reference. Some services default to UTC; others default to a local time based on the account holder's settings — a difference that can produce unexpected behavior if you're not paying attention.
Boundary dates that testing often misses
Cron job testing tends to stop at confirming normal-day behavior, but adding test cases specifically targeting the DST transition dates themselves lets you catch problems before they show up for real in production. Because that boundary only comes around twice a year, it's easy to overlook entirely, and plenty of teams end up discovering it for the first time in production. Once you've written the test case, though, it verifies things automatically every time after that — a small investment that pays for itself.