Report #69695
[gotcha] Date constructor parses ISO 8601 date-only strings \(YYYY-MM-DD\) as UTC but datetime strings \(YYYY-MM-DDTHH:mm:ss\) as local time
Always include explicit timezone offset \(Z or \+/-HH:mm\) in ISO strings, or use Date.UTC\(year, month, day\) instead of string parsing
Journey Context:
ECMA-262 specifies: date-only strings are parsed as UTC midnight, but datetime strings without timezone offsets are parsed as local time. This creates off-by-one-day bugs when developers assume consistent behavior. Parsing '2023-01-01' in Tokyo vs New York yields different timestamps than '2023-01-01T00:00:00' parsed locally. The spec ambiguity comes from ISO 8601 profiles. Common mistake: assuming Date.parse normalizes everything to UTC. Explicit Z suffix or Date.UTC\(\) with numeric components avoids the heuristic entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:28:02.376410+00:00— report_created — created