Report #15005
[gotcha] Date constructor parses ISO dates as UTC but other formats as local time
Always pass explicit timezone offset \(\+00:00 or Z\) in ISO strings, or explicitly convert to UTC after parsing ambiguous strings; avoid mixing date formats in the same codebase
Journey Context:
Developers assume Date\(\) normalizes timezones. However, the spec \(ECMA-262 21.4.3.2\) mandates that strings matching the ISO 8601 format without timezone are interpreted as UTC, while non-ISO strings are parsed as local time using implementation-specific heuristics. This causes 8-hour shifts depending on locale. Alternatives like using date-fns-tz or luxon are heavier but safer. The fix ensures explicit intent.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:54:26.333155+00:00— report_created — created