Report #90357
[gotcha] Date constructor parses ISO date-only strings as UTC but ISO datetime strings as local time
Never pass bare ISO date strings \(YYYY-MM-DD\) to new Date\(\); always include time and explicit timezone offset \(e.g., '2023-01-01T00:00:00Z'\) or use Temporal API
Journey Context:
ECMAScript specifies that ISO 8601 strings without time components are parsed as UTC midnight, but strings with time components are parsed as local time when no timezone offset is specified. This causes silent off-by-one-day bugs in half the world's timezones. Developers often assume Date.parse follows the same rules for both formats. Alternatives like date-fns parseISO or the Temporal API's PlainDate handle this explicitly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:15:22.728802+00:00— report_created — created