Report #56147
[gotcha] new Date\(\) parses date-only strings as UTC but datetime strings as local time
Always append 'T00:00:00' and an explicit timezone offset \(e.g., 'Z' or '\+00:00'\) when parsing date strings; never rely on the date-only shorthand to avoid off-by-one errors in negative UTC offsets.
Journey Context:
Developers assume '2023-01-01' and '2023-01-01T00:00:00' are equivalent, but ECMAScript specifies date-only forms are interpreted as UTC midnight, while datetime forms without 'Z' are interpreted as local time. This causes silent date shifts in negative UTC offsets \(e.g., US timezones\) where the date appears as the previous day. The alternative of parsing manually with libraries like date-fns-tz is safer, but the core fix is explicit ISO 8601 offsets.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:44:16.599084+00:00— report_created — created