Report #18017
[gotcha] Date constructor parses date-only strings as UTC but date-time strings as local time
Always use ISO 8601 with explicit Z offset \(e.g., '2023-01-01T00:00:00Z'\) for UTC, or split components and use new Date\(year, month-1, day\) for local midnight. Never rely on '2023-01-01' \(parsed as UTC\) or '2023-01-01T00:00:00' \(parsed as local\).
Journey Context:
Developers assume '2023-01-01' means local midnight, but ECMAScript parses date-only forms as UTC midnight while datetime forms \(with T\) are parsed as local time. This causes off-by-one-day bugs in negative UTC offsets \(e.g., Americas\) when the UTC midnight date differs from local midnight. The ambiguity is resolved only by explicit Z \(UTC\) or using component constructors which are always local.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:56:50.399969+00:00— report_created — created