GitHub issue: #10058 (opened with this content).
Schedule: IntervalSpec should advance by calendar days in ScheduleSpec timezone (DST)
IntervalSpec next-run calculation uses fixed UTC second alignment (((ts-phase)/interval+1)*interval+phase) and ignores ScheduleSpec.timezone for day-sized intervals. Schedules that mean “every N local days at a fixed local time” therefore do not track DST (e.g. US/Pacific: local midnight stays 07:00 UTC in PDT but should move to 08:00 UTC in PST after the fall transition).
StructuredCalendar / cron paths already use the loaded *time.Location; interval-only schedules do not.
ScheduleSpec.timezone=America/Los_Angeles(or any IANA zone with DST).Interval=24h,Phase=8h(first tick aligned to1970-01-01 00:00:00in that zone, i.e.time.Unix(8*3600,0)local representation).- Observe
rawNextTime/GetNextTimejust after 2018-11-04 local midnight and 2018-11-05 local midnight:- Before fix: every tick is
k * 86400seconds from the same UTC phase (e.g. always07:00Zin this setup). - After fix: 2018-11-04
00:00local is still PDT →07:00Z; 2018-11-0500:00local is PST →08:00Z.
- Before fix: every tick is
When interval is a positive multiple of 86400 and the schedule has a non-UTC location, interpret the step as N whole calendar days in that location at the same local time-of-day as the grid reference time.Unix(phase mod interval, 0).In(loc).
When the location is UTC (or unset/empty in a way that resolves to UTC), keep the existing fixed-UTC-second behavior for compatibility.
43hor other non–whole-day intervals: unchanged.- This does not try to turn “24h” into “civil 24h” in zone for non-86400-multiple durations.
Common use case: IntervalSpec for “every N days or weeks” with an end-user or workspace-scoped IANA time zone, so local wall time should remain stable when DST changes.
service/worker/scheduler/civil_interval.go: civil Julian day + scan for next local tick.service/worker/scheduler/spec.go:nextIntervalTimetakestime.Timeand callsnextCivilIntervalTickwhen applicable; otherwise same UTC math as before.TestSpecIntervalCivilDayUSPacificDST: 2018-11-04 vs 2018-11-05 local midnights.
- Schedules with no IANA offset (UTC-only behavior): unchanged.
- Schedules with a named non-UTC zone and day/week
Intervalaligned to 86400s: intentional behavior change to match wall-clock + DST (calendar semantics).
Possibly breaking:
ScheduleSpec.Intervalwith a duration of N×24h and a non-UTCScheduleSpectimezone now advances on civil calendar days in that zone. Previously, such intervals were aligned only to UTC 86400s boundaries. Clients that relied on the old UTC grid should set timezone toUTCor use calendar/cron for explicit UTC-day scheduling.
After merging, you can gh issue create / open the PR on https://github.com/temporalio/temporal with the same text.