Cron Job Running at the Wrong Hour: Timezone Traps

Symptom

Jobs fire hours early or late.

Root cause

crond evaluates entries in the server timezone; containers often default to UTC.

Fix, in order

1. Check the machine timezonetimedatectl # or date
2. Set the host timezone deliberatelysudo timedatectl set-timezone America/New_York
3. Or pin TZ per cron lineCRON_TZ=America/New_York 0 9 * * * /opt/scripts/morning.sh

Prevent it coming back

Write crons in UTC and convert in your head; document it in the crontab header.

Run it on clean infra

Spinning up a fresh box to reproduce or escape this error?

DevOps tools shelf

Related

Cloud & DevOps tool comparisons · Hardware build guides

NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.

Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog