Skip to main content
DevOps
Published 6 min read

Cron and Daylight-Saving Time: Skipped and Repeated Runs

A job at 02:30 may not run on the spring-forward day, and a job at 01:30 may match twice in autumn. Here is what to expect and how to plan around it.

A cron expression describes wall-clock times such as 02:30. Daylight-saving time breaks the assumption that every wall-clock time happens exactly once. On two days a year in many timezones a local time is either missing or repeated, and a schedule that lands on it behaves in a way the expression itself does not define.

A time that does not exist

In America/New_York the clocks jump from 02:00 to 03:00 on Sunday 14 March 2027. There is no 02:30 that day. A job written as 30 2 * * * therefore has nothing to match on that date. A preview that simply skips the date is honest; one that invents a run is not. What your scheduler does is its own decision: it may skip the run, run it late, or run it at an unexpected time.

A time that occurs twice

On Sunday 7 November 2027 the same zone moves from 02:00 back to 01:00, so 01:30 happens twice, an hour apart. A job at 30 1 * * * can match both instants. Some schedulers run it once, some twice, and which one depends on the implementation and the time it happens to look at the clock.

What Unix cron documents

Vixie-style cron describes special handling for clock changes of less than three hours: jobs at fixed times are run right after the change if their time was skipped, care is taken not to run jobs twice when the clock moves back, and jobs that run more often than hourly are scheduled normally. Other implementations, including Kubernetes, Quartz and Spring, do not promise the same.

Which jobs are affected

  • Fixed daily times inside the changing hour (for example 02:30 in zones that change at 02:00).
  • Hourly jobs are normally safe: the UTC spacing stays one hour, although one local hour is missing or repeated.
  • Every-few-minutes jobs keep their UTC spacing; only the local labels shift.
  • Jobs that must run once per local day are the most exposed, because that day is 23 or 25 hours long.

Not every day has 24 hours

A schedule of 0 9 * * * means 09:00 local every day, so the gap between two runs is 23 hours at spring forward and 25 hours at fall back. If you need a job exactly every 24 elapsed hours, a wall-clock schedule is the wrong tool. Use UTC, or an interval-based scheduler.

Practical advice

  • Run critical jobs in UTC, which has no clock changes, and document the conversion for people.
  • Avoid scheduling anything between 01:00 and 03:00 local time in zones that change clocks overnight.
  • Make jobs idempotent, so running twice or late is harmless, and add monitoring so a skipped run is noticed.
  • In Kubernetes set .spec.timeZone explicitly; in Spring set the zone attribute; do not rely on the server default.

Previewing clock-change days

The Cron Builder on DevCraftKit calculates run times from real timezone rules, never by adding 24 hours, and marks dates that hit a missing or repeated local time. It lets you choose whether a nonexistent time is skipped or shifted forward and whether a repeated time counts once or twice. Those are models for exploring the schedule: they cannot confirm what your scheduler will really do.

Conclusion

Cron expressions are wall-clock rules, and wall clocks are not perfectly regular. Decide deliberately which timezone a schedule uses, keep critical jobs away from the clock-change hours, and test the days when clocks change.

Frequently asked questions

Does a cron job run during the skipped hour in spring?
A time that does not exist cannot be matched literally, so a job scheduled at 02:30 on the spring-forward day has no 02:30 to fire at. Some schedulers skip it, some run it late, and some do not document the behavior.
Can a cron job run twice when clocks go back?
A local time such as 01:30 occurs twice. Whether a scheduler runs the job once or twice depends on the implementation. Vixie-style cron documents care to avoid running jobs twice for changes under three hours.
What is the safest way to schedule around DST?
Schedule in UTC, or pick a local time outside the hours that clocks change in your timezone, and make the job safe to run twice or not at all.

The tool that pairs with this guide.

Did this help you sort out your server configuration?

If these free developer tools save you time, consider buying me a byte. Your support helps keep DevCraftKit free and growing.

Buy me a byte 💾