Report #7505
[gotcha] \`new Date\('2023-01-01'\)\` parses as UTC but \`new Date\('2023-01-01T00:00:00'\)\` parses as local time, causing silent off-by-one-day bugs in production.
Always use explicit ISO 8601 format with \`Z\` suffix \(e.g., \`2023-01-01T00:00:00Z\`\) for UTC, or use a timezone-aware library like \`date-fns-tz\` or \`Luxon\` instead of native \`Date\` parsing.
Journey Context:
The ECMAScript spec treats date-only strings \(YYYY-MM-DD\) as UTC but date-time strings \(without timezone\) as local time. This inconsistency leads to frontend apps displaying the previous day when deployed to servers in different timezones than the developer's machine. Developers often assume 'no timezone means UTC' or that both forms behave identically. Using \`Z\` explicitly removes ambiguity, and libraries provide immutable, timezone-aware objects that don't rely on the browser's implementation of \`Date.parse\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:50:03.939584+00:00— report_created — created