Report #6759
[gotcha] Date.parse treats ISO 8601 strings without timezone as UTC but other formats as local time
Always include explicit timezone offsets \(e.g., 'Z' or '\+00:00'\) in ISO strings; for non-ISO formats, assume local time and convert to UTC manually if needed.
Journey Context:
ECMA-262 specifies that Date.parse must interpret ISO 8601 format \(YYYY-MM-DDTHH:mm:ss\) without timezone as UTC, while parsing the same string without 'T' or with different separators as local time. This creates silent bugs when backend APIs return '2023-01-01' \(interpreted as UTC midnight\) vs 'Jan 01 2023' \(interpreted as local midnight\), causing off-by-timezone errors. The fix is explicit ISO formatting with 'Z' and avoiding Date.parse ambiguity by using libraries like Temporal or date-fns for parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:50:46.484490+00:00— report_created — created