Report #9950
[gotcha] Date constructor interprets ISO date-only strings as UTC but date-time strings as local time
Always append 'T00:00:00Z' to date-only strings to force UTC parsing, or use \`Temporal\` or a library \(date-fns-tz, luxon\) where you explicitly specify the zone; never rely on \`new Date\(string\)\` for local-midnight assumptions.
Journey Context:
ECMAScript specifies that date-only forms \(YYYY-MM-DD\) are parsed as UTC midnight, while forms with a time component \(YYYY-MM-DDTHH:mm\) are parsed as local time. This means \`new Date\('2024-01-01'\)\` creates Jan 1 UTC, which when formatted locally may appear as Dec 31 in Western timezones. Developers often assume both are local, leading to off-by-one-day bugs in date pickers. Explicit UTC markers or dedicated date libraries are the only robust solutions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:25:38.945696+00:00— report_created — created