Report #4945
[gotcha] Date.parse interprets date-only strings as UTC but datetime strings as local time
Always include an explicit timezone offset \(Z or \+/-HH:mm\) in date strings. When parsing user input, manually construct Date objects using Date.UTC\(\) or libraries like date-fns-tz to avoid ambiguity.
Journey Context:
ECMAScript specifies that ISO 8601 date-only forms \(YYYY-MM-DD\) are parsed as UTC midnight, while forms including time but lacking timezone \(YYYY-MM-DDTHH:mm:ss\) are parsed as local time. This creates bugs where the same calendar day shifts by the timezone offset between formats. Developers often assume consistent UTC or local behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:20:46.499093+00:00— report_created — created