Why a Cron Job Runs at the Wrong Time
A cron job runs at the wrong time because the daemon reads the five fields in its own time zone, not UTC or yours. If the server sits in UTC and you wrote 9 AM, the job starts at 9 AM UTC. Daylight saving shifts that hour, so a job inside the 2 AM change can skip or repeat.
By Michael Lip · Updated 2026-10-28
Cron has no time zone field. The five fields are minute, hour, day of month, month and day of week. The daemon compares them to its own clock. Your own clock is a third clock, and the gap between the two is the bug.
Step 1: read the clock the daemon uses
date +'%Z %z'
timedatectl status 2>/dev/null | head -5
Run this on the machine that runs cron, not on your laptop. The output names the zone and the offset from UTC. When the server prints UTC and the crontab says 0 9 * * *, the job starts at 9 AM UTC.
Step 2: convert the intended time to that zone
Write the schedule in the daemon's zone. For a 9 AM Warsaw start on a UTC server in winter, write 8 AM, because Warsaw is UTC+1 in winter and UTC+2 in summer. A fixed cron line cannot follow that shift.
Step 3: decide what the job needs
Most jobs do not need a local wall clock. A backup that runs every six hours can stay in UTC. A report that a person reads at 9 AM local does need the local hour, and that is where daylight saving breaks a fixed line.
Daylight saving moves the hour
The macOS crontab(5) manual states the problem in its own words:
If you are in one of the 70-odd countries that observe Daylight Savings
Time, jobs scheduled during the rollback or advance will be affected. In
general, it is not a good idea to schedule jobs during this period.
A job at 2:30 AM local runs once, twice, or not at all, depending on the direction of the change. Move the job out of the 2 AM to 3 AM window. Pick 4 AM or 1 AM.
CRON_TZ is not portable
Some Linux cron builds read a CRON_TZ variable at the top of the file. The macOS crontab(5) page does not document it, and a search of that manual returns no match. Do not put CRON_TZ in a crontab and assume it works. Read the manual on the target machine first.
Fixes that work
- Write the fields in the daemon's zone. Print the zone on the server and keep it in a comment above the line.
- Run the job every hour and let the program decide. Compare the current hour in the target zone inside the script and exit when it is not the right one.
- Set
TZinside the command when the program itself needs a zone:TZ=Europe/Warsaw /usr/local/bin/report. This changes the program's clock, not the start time. - On Linux, a systemd timer with
OnCalendar=*-*-* 09:00:00 Europe/Warsawfollows the zone and the daylight saving change. - Log the start time in UTC. A wrong-hour bug is plain to see in a log that records the offset.
Check the expression before you deploy
Paste the line into the cron expression generator to read it in plain English. The next runs tool lists the coming execution times, so a mismatch with the server zone is visible before the job fires. The cron pattern research lists common schedules with their exact fields.
Frequently Asked Questions
Does cron use UTC?
No. The daemon uses its own system time zone, which is UTC only when the server is set to UTC.
How do I run a cron job at 9 AM my time?
Convert 9 AM in your zone to the same moment in the server's zone, then write that hour in the crontab.
Does CRON_TZ work on macOS?
The macOS crontab manual does not document CRON_TZ. Read the manual on the machine before you rely on it.