Report #79651
[gotcha] Date.parse and new Date\(string\) treat ISO 8601 date-only strings as UTC but date-time strings as local time, while non-ISO strings are implementation-defined
Always parse dates manually \(e.g., using date-fns-tz or Luxon\) or explicitly construct with \`new Date\(Date.UTC\(year, month, day\)\)\` to avoid timezone ambiguity; never rely on \`Date.parse\` for non-ISO strings across different JS engines.
Journey Context:
The spec mandates that only the full ISO 8601 format \(\`YYYY-MM-DDTHH:mm:ss.sssZ\`\) is parsed consistently. Date-only strings like \`2023-01-01\` fall into implementation-defined behavior, and major engines \(V8, SpiderMonkey\) treat them as UTC midnight, while strings with a time component but no \`Z\` are treated as local time. This causes off-by-one-day bugs when the local offset is negative \(e.g., Americas\) and code assumes local midnight.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:17:35.363357+00:00— report_created — created