Report #45999
[gotcha] Date.parse interprets ISO date-only strings \(YYYY-MM-DD\) as UTC but partial ISO strings \(YYYY-MM\) as local time
Avoid Date.parse for date-only values; use new Date\(year, monthIndex, day\) for local midnight or append an explicit time zone offset \(e.g., '2023-01-01T00:00:00-05:00'\) to force consistent ISO parsing
Journey Context:
The ECMAScript Date Time String Format treats date-only forms \(YYYY-MM-DD\) as UTC midnight, but incomplete forms like YYYY-MM fall back to implementation-specific heuristics. In V8/Node, YYYY-MM is parsed as local time midnight of the first day of that month. This creates off-by-one-day bugs for users west of UTC. The constructor form \(year, month, day\) is always local, and explicit offsets in strings remove ambiguity. Libraries like date-fns or Temporal handle calendar dates explicitly without these heuristics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:41:02.448307+00:00— report_created — created