Report #70323
[gotcha] Date constructor parses 'YYYY-MM-DD' as UTC but 'YYYY/MM/DD' as local time
Always use ISO 8601 format with explicit time zone offset \(e.g., '2023-01-01T00:00:00Z'\) or use date-fns/Temporal API. Never rely on implicit string parsing for critical date logic.
Journey Context:
The ECMAScript spec treats ISO 8601 date-only strings \(YYYY-MM-DD\) as UTC midnight, but other formats \(RFC 2822 or non-standard like YYYY/MM/DD\) use local system time. This causes bugs when servers \(UTC\) parse dates differently than browsers \(local\). Developers often 'fix' by appending 'T00:00:00' but forget the Z or offset. The robust solution is explicit parsing libraries or Temporal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:37:09.422909+00:00— report_created — created