Cron Jobs and Timezones: Why Your Report Runs at the Wrong Hour
"The report ran at 09:00." 09:00 where? If your cron job, your server, and your users live in different timezones, this question has already cost you a day of debugging. Here is the mental model that ends the confusion.
Cron knows nothing about timezones
The classic crontab format has no timezone field. Every cron expression is interpreted in one timezone only: whatever the CRON_TZ variable says, or the system timezone if it is unset. Most servers default to UTC. So 0 9 * * * runs at 09:00 UTC, which is 12:00 in Riga, 02:00 the next day in Auckland, and 01:00 or 02:00 there depending on daylight saving.
The failure pattern is always the same. You write the expression on a machine where it behaves the way you expect. It later moves to a staging box, a container, or a managed service with a different TZ, and the job silently shifts by hours. Nightly database dumps that fire at 09:00 local. Reminder emails that arrive at 03:00. Nothing errors — everything is just wrong.
Three things to check before writing any expression
- What timezone does the server run in? Run
timedatectlordateon the box. Do not guess from its region in the cloud console — a VPS bought in Frankfurt can happily run in UTC. - What timezone does the scheduler wrapper use? Laravel's scheduler, GitHub Actions, Airflow, and cloud "cron-like" services each have their own setting, and they do not inherit your shell's
TZ. Laravel, for example, reschedules everything throughapp.timezoneunless you callschedule:timezone. - What timezone does the user think in? "Morning report" means 09:00 in the office, not 09:00 in the datacenter. Convert once, document the resulting UTC time in a comment next to the cron line.
Daylight saving is the trap that keeps giving
If your server runs in a timezone with DST, expressions written for winter drift by an hour in summer. Worse: during a DST transition, 2:30 AM either does not exist (spring) or happens twice (autumn), so a job can be skipped or duplicated. This is a strong argument for keeping servers on UTC and converting at the edges. A job pinned to UTC never drifts; only its interpretation for humans changes.
If DST must be handled inside cron, CRON_TZ=Europe/Riga before the jobs handles it in modern vixie-cron implementations — but verify your platform supports it. Systemd timers, Kubernetes CronJobs, and serverless schedulers all handle this differently. Check the documentation for the one you actually use, not the one you remember.
Converting times without mistakes
Never do the arithmetic in your head across a DST boundary. "02:00 server time, that's 4 hours behind me, so 06:00" is exactly how 1-hour bugs are born. Convert with a tool that knows the zones and the DST rules:
1. Enter the target wall-clock time (e.g. 2026-10-25 02:30) — or a specific date near a DST change, since the offset differs by season.
2. Pick the source and target timezones explicitly.
3. Read the UTC result and pin the cron expression to UTC, so daylight saving never touches the schedule.
Our timezone converter does exactly this: pick two zones and a date, get the exact offset, including the days where the offset is not what you expect. One conversion, zero guesswork.
For writing the cron line itself, a checker will not help with timezones, but verifying the job actually fires at the pinned UTC minute beats trusting the crontab. Log the run timestamp, log it in UTC, and compare against the expression. If the log says 06:00:00 UTC and you expected 06:00 UTC, you are consistent. If it says 07:00 UTC, your wrapper applied its own offset — go find it.
Timestamps in logs and filenames
Two more habits that save post-mortems:
- Log in UTC, present in local. Store run timestamps as UTC (or unix timestamps) and convert for display only. Then "did the job run at 06:00 UTC?" is answerable from any log viewer without knowing the server's zone. Our unix timestamp converter reads any such value in one paste.
- Put the timestamp in filenames in UTC too.
backup-20261026-0600.sqlsorted chronologically against logs is only possible if both come from the same clock. A mix of local and UTC names makes incident timelines read like fiction.
Checklist before you close the ticket
- The cron expression is pinned to UTC (or
CRON_TZis set explicitly). - A comment next to the line records the intended local time and the offset it was built from.
- The first execution after writing showed the expected UTC timestamp in the logs.
- Anyone joining the team can answer "when does this actually run?" in under a minute.
Do those four things once per job, and the next "why did this run early?" conversation becomes a five-second answer instead of an afternoon.