Report #90525
[gotcha] Date parsing timezone inconsistency: YYYY-MM-DD treated as UTC but YYYY-MM-DDTHH:mm treated as local time
Always include explicit timezone offsets \(Z or \+/-HH:mm\) in datetime strings, or use date-fns/Temporal for explicit parsing strategies; never rely on the string format alone to infer timezone intent
Journey Context:
ECMAScript Date.parse implements ISO 8601 with a critical distinction: date-only strings \(YYYY-MM-DD\) are parsed as UTC midnight, while datetime strings without timezone offsets \(YYYY-MM-DDTHH:mm\) are parsed as local time. This causes subtle off-by-one-day bugs in negative UTC offsets \(e.g., US timezones\) where '2023-01-01' becomes Dec 31 locally, while '2023-01-01T00:00' remains Jan 1 locally. Developers often assume omitting the time component is equivalent to midnight local time, or that both forms share timezone semantics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:32:24.170426+00:00— report_created — created