Report #100606
[gotcha] Date.parse and new Date\(string\) treat date-only strings as UTC but date-time strings as local time
Always include an explicit timezone offset \(e.g., Z or \+00:00\) when parsing date strings, or construct dates from numeric components with Date.UTC\(\). Never rely on date-only string parsing for calendar dates.
Journey Context:
Date.parse\('2019-01-01'\) returns midnight UTC, but Date.parse\('2019-01-01T00:00:00'\) returns midnight in the local timezone. This causes off-by-one-day bugs for users west of UTC. The ECMAScript date-time string format specifies that date-only forms use UTC while date-time forms without an offset use local time. Libraries like date-fns-tz or luxon remove the ambiguity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T04:47:22.172083+00:00— report_created — created