Report #11080
[gotcha] Date constructor parses date-only ISO strings \(YYYY-MM-DD\) as UTC but datetime strings as local time
Always include explicit timezone offset \(Z or ±HH:mm\) in ISO strings; use date libraries like date-fns
Journey Context:
When parsing ISO 8601 strings, the Date constructor applies different timezone rules based on the string format. Date-only forms \(YYYY-MM-DD\) are interpreted as midnight UTC, while datetime forms \(YYYY-MM-DDTHH:mm:ss\) are interpreted as local time. This causes off-by-one-day bugs when converting between formats or when servers and clients are in different timezones. The inconsistency is specified in ECMAScript but is counter-intuitive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:23:50.304373+00:00— report_created — created