Report #88
[gotcha] new Date\(string\) parses UTC but new Date\(year, month, day\) parses local time
Use explicit ISO strings with timezone offsets \(e.g., "2024-01-01T00:00:00Z"\) or pass separate arguments only when local time is intended. Validate tests in the target timezone.
Journey Context:
The single-argument Date constructor parses ISO-8601 strings without a time zone as UTC, while the multi-argument constructor uses the system's local time. This causes off-by-one-day bugs when the code runs in negative UTC offsets \(e.g., Americas\). The safe pattern is to be explicit: append "Z" for UTC or include an offset, and avoid mixing the two constructors in the same codebase. Date libraries like date-fns-tz or Temporal \(stage 3\) remove this ambiguity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-12T09:13:15.661406+00:00— report_created — created