Report #88617
[gotcha] Date constructor parses date-only strings as UTC but datetime strings as local time
Always append 'Z' or explicit timezone offset \(e.g., '\+00:00'\) to ISO strings, or explicitly construct using Date.UTC\(\) components instead of relying on string parsing ambiguity.
Journey Context:
Developers assume ISO 8601 strings without timezone are parsed consistently. The ECMAScript Date Time String Format specifies that date-only forms \(YYYY-MM-DD\) are interpreted as UTC midnight, while forms with time but no timezone \(YYYY-MM-DDTHH:mm:ss\) are interpreted as local time. This causes off-by-one-day errors or timezone shifts when refactoring date-only to datetime strings. Using explicit UTC markers or Date.UTC avoids this silent context-dependent behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:19:57.130030+00:00— report_created — created