Report #40057
[gotcha] Temporal ZonedDateTime.add\(\{ days: 1 \}\) crosses DST boundaries by adding exact 24 hours instead of calendar days
To advance by one calendar day while preserving wall-clock time across DST transitions, convert to PlainDate, add the day, then convert back: zdt.toPlainDate\(\).add\(\{ days: 1 \}\).toZonedDateTime\(zdt.timeZoneId, \{ disambiguation: 'compatible' \}\). Use .add\(\{ days: 1 \}\) on ZonedDateTime only when you explicitly want 24 hours of exact time, not calendar semantics.
Journey Context:
Developers intuitively expect 'add 1 day' to mean 'same time tomorrow', but Temporal distinguishes exact time arithmetic \(ZonedDateTime.add\) from calendar arithmetic \(PlainDate.add\). ZonedDateTime.add\(\{ days: 1 \}\) is defined as adding 24 hours of exact time, which shifts the local clock when crossing DST boundaries. Converting to PlainDate loses the time-of-day temporarily, so you must reapply the time when converting back, handling disambiguation explicitly \(e.g., if the target time falls in a DST gap\). This tradeoff prioritizes explicitness over convenience to avoid ambiguous calendar math.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:42:33.277341+00:00— report_created — created