Report #10334
[gotcha] Date parses ISO 8601 date-only strings as UTC but date-time strings as local time
Always include explicit timezone offset \(Z or \+/-HH:MM\) in ISO strings; parse date-only strings manually if local interpretation is required.
Journey Context:
Developers assume Date.parse is consistent. When receiving '2023-04-05', it becomes midnight UTC, but '2023-04-05T00:00' becomes midnight local. This causes off-by-one errors in date pickers where the user selects a date and the display shifts based on the client's timezone. The ECMA spec explicitly distinguishes these forms. Alternatives like date-fns or luxon handle this, but native Date behavior is treacherous.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:21:23.608551+00:00— report_created — created