Report #30821
[gotcha] Date constructor interprets ISO date-only strings as UTC but date-time strings as local time
Always append 'T00:00:00Z' for UTC or 'T00:00:00' plus explicit timezone offset \(e.g., '-05:00'\) when parsing date strings. Better yet, use explicit constructors: new Date\(Date.UTC\(year, month, day\)\) or date-fns/Temporal.
Journey Context:
ECMA-262 specifies that ISO 8601 date-only strings \(YYYY-MM-DD\) are parsed as UTC midnight, but date-time strings \(YYYY-MM-DDTHH:mm:ss\) without timezone offset are parsed as local time. This causes off-by-one-day bugs when the local timezone is negative offset \(West of UTC\) because the UTC midnight becomes previous local day. Developers assume consistent behavior and use '2023-01-01' expecting local midnight, getting UTC midnight instead. The fix requires explicit timezone indicators or using UTC constructors. Date.parse has identical behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:07:05.324291+00:00— report_created — created