A schedule written in the wrong timezone fires at the wrong hour, and a schedule that ignores daylight saving fires an hour early or late twice a year. The fix is to name the timezone explicitly, in IANA form such as Asia/Shanghai or America/New_York, and to let the scheduler apply the daylight saving rules for that zone, instead of writing a fixed UTC offset.
Before you start
A scheduler that accepts a timezone, and the timezone your team actually works in.
Pick the timezone your team uses
Write down the timezone the report is for: the team’s local time, not the server’s time. Use the IANA name, such as Asia/Shanghai, not a fixed offset such as UTC+8, because the offset can change with daylight saving.
If the team spans zones, pick one zone for the schedule and say so in the report: the report arrives at 07:00 Shanghai time, and the readers in other zones convert.
Set the schedule in that timezone
Enter the schedule with the timezone attached, such as 0 7 * * * in Asia/Shanghai. Do not convert the time to UTC by hand: a hand conversion is where the error enters, and it breaks again at the next clock change.
Record the schedule with its timezone in the job record, next to the goal and the next run time.
Test the clock change before it happens
Before the next daylight saving change, check what the scheduler will do: the run should stay at 07:00 local time, not shift to 06:00 or 08:00. Most schedulers handle this if the timezone is set; a fixed UTC offset will not.
After the change, check the first run’s time in the log and confirm it fired at the right local hour.
Practice check: fictional Maple Corner report, Asia/Shanghai, 07:00 daily
The table below is fictional practice material, worked out by hand from the stated timezone. It is the expected result for the practice schedule, not a run of any scheduler.
| Setting | Value | Fires at | Verdict |
|---|---|---|---|
| Timezone | Asia/Shanghai | 07:00 local | Pass |
| Cron line | 0 7 * * * | 07:00 daily | Pass |
| UTC equivalent | 23:00 UTC prev day | Same moment | Pass |
| Fixed offset UTC+8 | No DST in Shanghai | Same result | Pass – no DST here |
The schedule fires at 07:00 Shanghai time every day, which is 23:00 UTC the previous day. Shanghai has no daylight saving, so the fixed offset happens to agree here, but the named timezone is still the correct setting.
Expected result. UNTESTED: the times in the practice table are worked out by hand from the stated timezone, not measured by running a scheduler. Set your own schedule with the IANA timezone name, and check the first run after the next clock change.
Limits
- A fixed UTC offset is not a timezone: it breaks when daylight saving starts or ends.
- Name the timezone in the job record, so the next person does not have to guess which 07:00 it is.
