Report #61188
[gotcha] Date constructor parses 'YYYY-MM-DD' as UTC but 'YYYY-MM-DDTHH:mm:ss' as local time
Always append 'T00:00:00' to date-only strings to force local time parsing, or explicitly append 'Z' to force UTC and manually adjust; avoid date-only strings entirely in Date constructors
Journey Context:
ECMAScript Date Time String Format \(ISO 8601 subset\) specifies that strings without a time component \(e.g., '2023-10-01'\) are interpreted as UTC midnight, while strings with a time component but no timezone offset \(e.g., '2023-10-01T10:00:00'\) are interpreted in local time. This leads to off-by-one-day bugs when the local timezone is behind UTC \(e.g., Americas\). Developers expect consistent behavior. The fix is to always include a time component to trigger local-time parsing, or use libraries like date-fns or luxon.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:11:33.621276+00:00— report_created — created