Cron time zones and daylight saving: why jobs skip or run twice

Cron jobs scheduled in local time can skip or double-run when clocks change. How time zones work in cron, systemd and Kubernetes, and how to schedule safely.

· 6 min read · By the Spot Downtime team

A nightly job that has run fine for months suddenly runs an hour late, runs twice, or does not run at all on one night in spring or autumn. Nothing changed in the code. The clocks did.

Cron schedules are written in wall-clock time, and wall-clock time has gaps and repeats. This guide covers what goes wrong, how to see which time zone your scheduler uses, and how to avoid the problem.

What goes wrong

Take a system in a time zone that observes daylight saving time (DST), such as America/New_York:

  • Spring forward. The clock jumps from 01:59 to 03:00. The times between 02:00 and 02:59 do not exist that night. A job scheduled for 30 2 * * * has no 02:30 to run at.
  • Fall back. The clock goes from 01:59 back to 01:00. Everything from 01:00 to 01:59 happens twice. A job at 30 1 * * * can run twice, and an hourly job can appear to run two times in the same clock hour.

The result is a skipped backup, a double-sent invoice batch, or a report built from two overlapping runs. The risk is highest for jobs in the 01:00 to 03:00 window, which is also a popular time to schedule maintenance.

Different cron implementations handle the change differently. Some try to compensate for clock changes under a few hours by running skipped jobs right after the jump and not repeating fixed-time jobs on the way back. Others do not. Check man 5 crontab on your system, and do not rely on it.

Which time zone does your scheduler use?

Most surprises come from not knowing the answer. It differs by tool:

Classic cron

Cron uses the system time zone of the machine by default. Check it:

date
timedatectl | grep "Time zone"

Some implementations, such as cronie, accept a CRON_TZ variable in the crontab to set a zone for the jobs below it. Not every cron supports it, so confirm in the manual for your version:

CRON_TZ=UTC
0 3 * * * /usr/local/bin/backup.sh

systemd timers

OnCalendar expressions can name a zone. Use UTC to sidestep DST:

[Timer]
OnCalendar=*-*-* 03:00:00 UTC
Persistent=true

Persistent=true makes a timer that was missed while the machine was off run at the next boot, which helps with laptops and servers that reboot.

Kubernetes CronJob

Without a setting, a CronJob schedule is interpreted in the time zone of the kube-controller-manager. From Kubernetes 1.27 you can set spec.timeZone explicitly:

apiVersion: batch/v1
kind: CronJob
metadata:
  name: nightly-report
spec:
  schedule: "0 3 * * *"
  timeZone: "Etc/UTC"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: report
              image: example/report:latest

Hosted schedulers

GitHub Actions schedules run in UTC. Cloud schedulers and CI systems each have their own default, and some let you pick a zone per schedule. Read the setting rather than assuming.

Fixes that work

  1. Run servers and schedules in UTC. UTC has no DST, so every time exists exactly once. Convert to local time only when you show it to people. This removes the whole class of problem.
  2. Avoid the danger window. If you must use local time, do not schedule at 01:00 to 03:00 local time. Pick a time such as 04:30 that is never skipped or repeated in common zones.
  3. Make jobs idempotent. A job that can run twice without harm survives the fall-back hour. Use a lock file, flock, or a database record of the last processed period.
  4. Process by period, not by “now”. A report job should compute “yesterday in UTC” from a parameter, so a late or repeated run produces the same result.
  5. Tell people the time zone. A cron comment such as # 03:00 UTC saves the next engineer from guessing.
# prevent overlapping or repeated runs
0 3 * * * flock -n /var/lock/backup.lock /usr/local/bin/backup.sh

Beyond DST

Time zone rules themselves change when governments change them. Keep the tzdata package updated on servers and in container images, or your local-time schedules will drift from reality.

Check your schedule before the next change

Compute the next run times of an expression and compare them with the clock you actually care about. Our cron expression explainer helps you confirm what a schedule means. To simulate a time zone from the shell:

TZ=America/New_York date -d "2026-11-01 01:30" +"%F %T %Z"

In 2026, US clocks go back on Sunday 1 November and European clocks go back on Sunday 25 October. If a job of yours runs between 01:00 and 03:00 local time, look at its logs for those nights.

Know when a job missed its slot

A skipped run is silent: nothing fails, so no error is logged. The way to catch it is to monitor for the success signal. Make the job call a heartbeat URL when it finishes, and get alerted when the call does not arrive on time. Spot Downtime's cron job monitoring works this way, and the setup guide shows the crontab line. If the job already seems to stop for no reason, see why a cron job is not running.

Cron expression explainerPaste a schedule and read what it means in plain language.

Get new guides by email

Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.

Unsubscribe from any email with one click. See our privacy policy.

Keep reading