brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: a time zone in OnCalendar= runs a systemd timer on another clock

Systemd
~/tips/tip-systemd-timer-timezone

[Timer]

Schedule a timer in local office time while the server itself runs on UTC.

Servers often run on UTC, which is great for logs and awful for anything that should happen at nine in the morning local time, especially across daylight saving changes.

Add a time zone name at the end of the calendar expression:

[Timer]
OnCalendar=Mon..Fri *-*-* 09:00 Europe/Amsterdam
Persistent=true

The timer then follows that zone’s clock, including the switch between summer and winter time. Check it before you trust it:

systemd-analyze calendar '*-*-* 02:30 Europe/Amsterdam'

On a UTC box that prints Next elapse: Tue 2026-12-01 01:30:00 UTC, which is 02:30 Amsterdam winter time. After loading such a timer, systemctl list-timers shows the same converted time.

I think it beats changing the server’s own time zone just for one job, and it is clearer than writing a UTC time and remembering to move it twice a year.

Pick times outside the daylight saving jump. A job at 02:30 local time does not exist on the night the clocks go forward and happens on the night they go back, when 02:30 comes around twice. Times like 03:30 or 09:00 avoid that whole question. The zone name has to be one of the names under /usr/share/zoneinfo.

Further reading: systemd.timer man page, systemd.time man page

More Systemd tips [Service] sudo mkdir -p /etc/systemd/system/service.d [Service] printf 'hunter2' | sudo systemd-creds encrypt --name=dbpass – dbpass.cred systemd-analyze timespan 1h30min All Systemd tips (88) All topics

Link