mikker/tiny-cron Public
MK

Fix DST spring-forward skipping hourly jobs in Europe/Copenhagen

#142
Open sara-k wants to merge 2 commits into main from sara-k:fix-dst-gap
Conversation 4 Commits 2 Checks 4 Files changed 2
+38 -6
SK
sara-k Human opened 2 hours ago Contributor

Hey! Hit this while deploying invoice reminders in Copenhagen today. Our 02:00 job skipped on spring-forward Sunday. Not sure how you prefer DST gaps handled, so I left my agent's notes below.

👋 1
claude-code for sara-k · Clamp nonexistent DST times in nextRun(), 2 files ✓ 14/14
Tests ✓ 14/14 Typecheck ✓ tsc Files schedule.ts, dst.test.ts Model claude-opus-4-6
Root cause
nextRun() in src/schedule.ts:84 builds wall-clock times with setHours(). On 2026-03-29, 02:00 does not exist in Europe/Copenhagen, so the job skips the day.
Changes
Clamps nonexistent local times to the first valid minute after the gap (03:00). Adds regression tests for Europe/Copenhagen and America/New_York.
claude-code 2.1 · 2 hours ago
sara-k pushed 2 commits · 8a1f3c2 clamp nonexistent DST minutes
2 agent entries hidden
MK
mikker Human replied 18 minutes ago Maintainer

Thanks for reporting and sending a fix, Sara! Clamping to 03:00 makes sense. My agent caught a half-hour timezone edge case below. Ready to merge once that's in.

codex for mikker · Half-hour DST shift in src/schedule.ts:91
Location src/schedule.ts:91
Finding
dstGapMinutes = 60 assumes 1-hour shifts. In 30-minute DST zones such as Australia/Lord_Howe, it skips a valid 02:30 run.
Suggestion
Compute the gap from getOffset(t + 3600e3) - getOffset(t - 3600e3) instead of hardcoding 60.
codex · 18 minutes ago
SK
Write Preview
Human
SK
claude-code opened on behalf of sara-k · 2 hours ago ✓ 14/14
Tests ✓ 14/14 Typecheck ✓ tsc Files schedule.ts, dst.test.ts Model claude-opus-4-6
Root cause
nextRun() in src/schedule.ts:84 builds wall-clock times with setHours(). On 2026-03-29, 02:00 does not exist in Europe/Copenhagen, so the job skips the day.
Changes
Clamps nonexistent local times to the first valid minute after the gap (03:00). Adds regression tests for Europe/Copenhagen and America/New_York.
claude-code 2.1 · 2 hours ago
MK
Write Preview
Human