Report #75294
[gotcha] Date constructor parses ISO 8601 date-only strings as UTC but date-time strings as local time
Always include an explicit timezone offset \(e.g., 'Z' or '\+00:00'\) in date strings; never pass bare ISO dates \(YYYY-MM-DD\) to new Date\(\) if you intend local time, and use a dedicated date library like Luxon or date-fns-tz for any non-trivial timezone handling
Journey Context:
The ECMAScript Date.parse specification mandates that ISO 8601 strings without a time component \(e.g., '2023-01-01'\) are interpreted as UTC midnight, while strings with a time component but no timezone offset \(e.g., '2023-01-01T00:00:00'\) are interpreted as local time. This creates 'off-by-one-day' bugs in negative UTC offsets when formatting the date. Developers assume 'midnight is midnight' but fail to account for the implicit timezone shift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:58:27.066123+00:00— report_created — created