Report #94858
[gotcha] Date constructor parses ISO 8601 date-only as UTC but date-time as local time
Always include explicit timezone offset \(e.g., 'Z' or '\+00:00'\) or use separate date-only fields; never rely on bare ISO date strings for local midnight calculations.
Journey Context:
Developers assume ISO 8601 strings behave consistently. However, ECMA-262 specifies that date-only forms \(YYYY-MM-DD\) are parsed as UTC midnight, while date-time forms \(YYYY-MM-DDTHH:mm:ss\) are parsed as local time. This causes off-by-one day errors in negative UTC offsets and subtle scheduling bugs. Using explicit offsets or separate date management libraries \(like date-fns-tz\) eliminates ambiguity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:48:04.819482+00:00— report_created — created