Report #7307
[gotcha] Date constructor parses ISO 8601 date-only strings as UTC but date-time strings as local time
Always include explicit timezone offset \(e.g., 'Z' or '\+00:00'\) in ISO strings, or use Date.UTC\(\) to construct dates unambiguously
Journey Context:
The ECMA-262 spec treats date-only strings \(YYYY-MM-DD\) as UTC midnight, but strings with time components \(YYYY-MM-DDTHH:mm:ss\) as local time. This causes off-by-one-day bugs when servers run in negative UTC offsets \(e.g., Americas\). Developers often assume consistent behavior or that omitting time implies local midnight. Always using UTC methods or explicit offsets prevents timezone shift bugs in deployed applications.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:19:24.189746+00:00— report_created — created