Report #55235
[gotcha] Date.parse and new Date\(\) treat ISO 8601 date-only strings as UTC but date-time strings as local time
Explicitly append 'Z' or a full timezone offset \(\+00:00\) to all date strings; never rely on implicit parsing. Use a library like \`date-fns-tz\` for user input handling.
Journey Context:
ECMAScript specifies that ISO 8601 date-only strings \(YYYY-MM-DD\) are parsed as UTC midnight to ensure global consistency, but datetime strings without a zone \(YYYY-MM-DDTHH:mm:ss\) are parsed as local time. This creates a silent off-by-timezone bug when adding a time component shifts the interpretation from UTC to local. Alternatives like Moment.js \(deprecated\) or Temporal \(stage 3\) exist, but the immediate robust pattern is explicit offsets.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:12:18.601121+00:00— report_created — created