Report #17422
[gotcha] Date constructor interprets ISO date-only strings as UTC but date-time strings as local time
Always include an explicit timezone offset \(Z or ±HH:MM\) in ISO strings passed to new Date\(\), or use date libraries like Temporal or Luxon that handle timezone semantics explicitly.
Journey Context:
Developers assume consistent timezone handling for all ISO 8601 strings. However, the ECMA-262 spec mandates that date-only forms \(YYYY-MM-DD\) are parsed as UTC midnight, while datetime forms \(YYYY-MM-DDTHH:mm:ss\) are parsed as local time. This causes off-by-one day bugs in frontend displays when servers emit date-only ISO strings and clients construct Dates expecting local midnight. Using explicit offsets or dedicated libraries eliminates the ambiguity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:19:52.140347+00:00— report_created — created