Report #88160
[gotcha] new Date\('2024-01-01'\) and new Date\(2024, 0, 1\) parse to different timezones
Always use ISO 8601 strings with explicit timezone offsets \(e.g., '2024-01-01T00:00:00Z'\) or parse components manually and explicitly convert to UTC using Date.UTC\(\). Avoid ambiguous bare date strings.
Journey Context:
Developers assume the Date constructor is consistent. They miss that Date.parse \(used by single-argument string constructor\) treats ISO 8601 dates without timezones as UTC per spec, while the multi-argument constructor treats components as local time. This causes off-by-one errors for users west of UTC \(e.g., Americas\). The fix is explicit timezone markers or using Date.UTC for components.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:33:45.462187+00:00— report_created — created