"One day later" and "24 hours later" are different quantities — the batch job that drifts an hour every spring
The code didn't change. The schedule did. There's a batch job on a US East Coast server that runs every morning at 9:00. It has been running fine for months — until the second Sunday of March, when it quietly starts running at 10:00 every morning. Nobody deployed anything. The cause usually looks like this: next = prev + 24 * 60 * 60 * 1000; // "one day later" The US East Coast switches to…
On the day following the change to daylight saving time, a batch job that runs daily at 9:00 started running one hour later. The issue arose because the code treated "one day" as both a civil day and 24 hours, while the actual clock difference is 23 hours due to the time jump. This discrepancy caused the batch job to execute at 10:00 instead of the intended 9:00 on the transition day.
The problem stems from mixing civil time and elapsed time within the same expression, which is not allowed in the Kairos schedule definition language used. Kairos addresses this issue by separating the two quantities at the literal level, with 1d representing a civil day and 24h representing elapsed time. The language rejects mixed widths at parse time, preventing the bug from occurring.
Additionally, the language ensures that nonexistent times, such as the 02:30 gap during daylight saving time transitions, cannot be represented as data, preventing silent errors.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.