Report #52853
[gotcha] Date constructor parses ISO date-only strings as UTC but date-time strings without Z as local time
Always append 'T00:00:00' to date-only strings if you want local midnight, or explicitly use UTC methods. For consistent behavior, use a library like date-fns-tz or luxon.
Journey Context:
The ECMAScript spec treats date-only \(YYYY-MM-DD\) as UTC midnight, but adding a time component without 'Z' switches parsing to local timezone. This causes off-by-one-day bugs when the local offset is negative \(west of UTC\) because the UTC date differs from local. Many assume the Date constructor always uses local time or always UTC, but it's a hybrid.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:12:33.247554+00:00— report_created — created