Report #91386
[gotcha] Date constructor parses ISO 8601 strings without timezone as UTC but non-ISO strings as local time
Always include explicit timezone offsets \(e.g., '2023-01-01T00:00:00Z'\) when parsing date strings, or use Date.UTC\(\) with numeric components to avoid ambiguity.
Journey Context:
ECMA-262 specifies that Date.parse must interpret ISO 8601 dates without timezones as UTC, but any other format \(like '1/1/2023'\) is parsed as local time. This causes silent off-by-one-day bugs when servers emit ISO midnight dates and clients in negative offsets display the previous day. The fix is explicit offsets or numeric construction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:59:05.470751+00:00— report_created — created