Skip to content

Conversation

@d4rken
Copy link
Member

@d4rken d4rken commented Dec 15, 2025

Scheduled tasks now maintain correct local time across daylight saving time transitions. Previously, schedules set for 10:00 would shift to 11:00 (or 09:00) after DST changes.

The fix stores the user's timezone when enabling a schedule and uses calendar arithmetic (plusDays) instead of duration arithmetic (plus(Duration)) for time calculations. This ensures local time is preserved even when UTC offsets change.

Changes:

  • Added userZone field to Schedule for storing timezone at enable time
  • Changed from Duration to calendar arithmetic in calcExecutionEta
  • Added resolveZone() helper with fallback for invalid/missing timezones
  • Added DST-specific tests for spring forward and fall back scenarios

Closes #768

Scheduled tasks now maintain correct local time across daylight saving time
transitions. Previously, schedules set for 10:00 would shift to 11:00 (or 09:00)
after DST changes.

The fix stores the user's timezone when enabling a schedule and uses calendar
arithmetic (plusDays) instead of duration arithmetic (plus(Duration)) for
time calculations. This ensures local time is preserved even when UTC offsets
change.

Changes:
- Added userZone field to Schedule for storing timezone at enable time
- Changed from Duration to calendar arithmetic in calcExecutionEta
- Added resolveZone() helper with fallback for invalid/missing timezones
- Added DST-specific tests for spring forward and fall back scenarios

Closes #768
@d4rken d4rken added bug Something isn't working as expected c: Scheduler labels Dec 15, 2025
@d4rken d4rken merged commit 3e06b19 into main Dec 15, 2025
13 checks passed
@d4rken d4rken deleted the scheduler-summertime-768 branch December 15, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected c: Scheduler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Summer / Winter time Bug

2 participants