Report #51970
[gotcha] Date-only strings \(YYYY-MM-DD\) parse as UTC, datetime strings as local time
Always include an explicit timezone offset \(e.g., \`Z\` or \`\+00:00\`\) in date strings, or use a robust library like \`date-fns\` or \`Luxon\`. Never rely on \`new Date\(string\)\` without timezone specifiers.
Journey Context:
Per ECMA-262 Date.parse, ISO 8601 date-only strings \(e.g., \`2023-01-01\`\) are interpreted as UTC midnight, whereas strings containing a time component \(e.g., \`2023-01-01T00:00\`\) are interpreted as local time. This creates a discontinuous offset of several hours between seemingly similar inputs, causing 'off-by-one-day' bugs in date pickers when the host timezone is behind UTC. The spec behavior is mandated for ISO 8601 compliance. The only mitigation is explicit timezone markers or avoiding native Date parsing entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:43:28.546137+00:00— report_created — created