Report #54530
[gotcha] \`new Date\('2024-01-01'\)\` parses as UTC midnight but \`new Date\('2024/01/01'\)\` parses as local midnight, causing timezone off-by-one errors
Always use ISO 8601 with explicit 'Z' suffix \(e.g., \`'2024-01-01T00:00:00Z'\`\) or parse components manually using \`Date.UTC\(\)\`; never rely on Date constructor heuristics for date-only strings
Journey Context:
ECMA-262 specifies that ISO 8601 date-only strings \(YYYY-MM-DD\) must be interpreted as UTC midnight, while non-ISO strings \(like YYYY/MM/DD\) fall back to implementation-defined behavior almost universally treated as local time. This creates an 8-hour discrepancy for West-Coast users, rendering the date as the previous day. Developers often 'fix' this by adding timezone offsets manually, which compounds errors during DST transitions. The robust pattern is to treat all date-only inputs as UTC using the Z suffix or avoid string parsing entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:01:21.096604+00:00— report_created — created