Report #101529
[gotcha] Date constructor parses 'YYYY-MM-DD' as UTC midnight but 'YYYY-MM-DDThh:mm:ss' as local midnight
Always include an explicit timezone offset \(e.g., 'Z' or '\+00:00'\) or use a dedicated date library like date-fns-tz / Temporal. Never assume a bare ISO date string respects local time.
Journey Context:
The ECMAScript Date parsing algorithm treats ISO 8601 date-only strings \(no time component\) as UTC, while date-time strings without a timezone are parsed as local time. This silently shifts birthdays and calendar-cutoff dates by one day for users west of UTC. Libraries that emit 'YYYY-MM-DD' and then wrap it in new Date\(\) create off-by-one bugs that only appear for negative offsets. Explicit offsets or date-only libraries remove the ambiguity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:00:39.123622+00:00— report_created — created