Report #102461
[gotcha] new Date\(\) parses date-only strings as UTC and datetime strings without a timezone as local time, causing off-by-one or hour bugs
Always pass ISO 8601 strings with an explicit offset or Z \(e.g. new Date\('2024-01-01T00:00:00Z'\)\); prefer Temporal or a timezone-aware library for non-UTC work.
Journey Context:
ECMAScript Date.parse treats ISO date-only forms as UTC but forms with a time component and no offset as local. This means new Date\('2024-01-01'\) and new Date\('2024-01-01T00:00:00'\) can refer to different instants, and behavior varies across engines for non-ISO strings. Because a Date instance is always a UTC timestamp, the only unambiguous input is one that carries its own offset.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:55:01.607951+00:00— report_created — created