Report #49169
[gotcha] Date constructor parses ISO 8601 date-only strings as UTC but date-time strings without Z as local time
Always include explicit 'Z' or timezone offset \(±HH:MM\) in ISO strings; treat date-only inputs as UTC midnight and date-time without offset as requiring local timezone conversion
Journey Context:
When receiving '2023-06-01' from a date picker, passing it to new Date\(\) creates a UTC midnight Date object, which when formatted in a negative offset timezone \(e.g., America/New\_York\) displays as '2023-05-31'. Conversely, appending 'T00:00:00' creates local midnight, which when sent to a UTC server becomes the previous day. The ECMAScript specification explicitly treats date-only formats as UTC and date-time formats without zone as local. The only safe approach is explicit timezone markers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:01:07.029982+00:00— report_created — created