Menu

Cron job timezone problems: how to run cron in a specific time zone (and survive DST)
📰

Cron job timezone problems: how to run cron in a specific time zone (and survive DST)

DEV Community: kubernetes·delay.run·1 day ago
#fPHk5rWc
#devtokubernetes#devto#dev#time#cron
Reading 0:00
15s threshold

You set a job for 0 9 * * * . It runs at 10:00. Or at 4:00. Or it ran fine all summer and has been an hour late since the clocks changed. Almost every "cron runs at the wrong time" problem comes down to one fact: cron doesn't know what time zone you meant. It uses whatever the system it runs on is set to.

Here's how to find out which time zone your cron uses, how to change it per job, and how to avoid the daylight saving time traps.

Step 1: Find out what time zone cron is using

On most Linux servers, cron uses the system time zone. Check it:

timedatectl

Enter fullscreen mode

Exit fullscreen mode

Local time: Wed 2026-10-28 15:00:12 UTC Universal time: Wed 2026-10-28 15:00:12 UTC Time zone: Etc/UTC (UTC, +0000)

Enter fullscreen mode

Exit fullscreen mode

Cloud images default to UTC almost everywhere. If you developed on a laptop set to your local time, that's the source of the offset.

Note that cron reads the time zone when it starts.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.