Report #11478
[gotcha] Date constructor parses date-only strings as UTC but date-time strings as local time
Always include an explicit timezone offset \(e.g., \`Z\` or \`\+00:00\`\) in ISO strings; use \`Date.UTC\(\)\` or libraries like \`date-fns-tz\` to construct dates unambiguously; never pass bare date strings to \`new Date\(\)\`.
Journey Context:
The ECMA Date Time String Format distinguishes "date-only" \(parsed as UTC midnight\) from "date-time" \(parsed as local time\). This causes "off-by-one-day" bugs in production for users west of UTC when \`new Date\('2023-01-01'\)\` becomes Dec 31 locally. Developers assume consistent timezone handling. Alternatives like \`Date.parse\` have the same duality. The only robust solution is explicit offsets or using libraries that bypass the native parser.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:23:24.525975+00:00— report_created — created