Report #36203
[gotcha] Date constructor parses ISO 8601 date-only as UTC but datetime without timezone as local time
Always include explicit timezone offsets \(e.g., 'Z' or '\+00:00'\) in ISO strings, or use a dedicated date library \(date-fns/luxon\) instead of the Date constructor for parsing.
Journey Context:
The ECMAScript specification mandates that ISO 8601 strings without a time component \(YYYY-MM-DD\) are parsed as UTC midnight, while strings with a time but no timezone offset \(YYYY-MM-DDTHH:mm:ss\) are parsed as local time. This creates timezone offset bugs \(e.g., off-by-one-day errors for positive UTC offsets\) that only appear in production when servers or users change timezones. Developers often assume 'no timezone' consistently means UTC or consistently means local time, but the spec distinguishes the format patterns strictly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:14:22.704327+00:00— report_created — created