Report #100133
[gotcha] new Date\('2024-01-01'\) and new Date\('2024-01-01T00:00:00'\) parse into different timezones
Always include an explicit timezone offset \(e.g. 'Z' or '\+00:00'\) in date strings, or use a dedicated library like date-fns-tz or Temporal. Treat bare date-only strings as UTC midnight and local date-time strings as ambiguous.
Journey Context:
The ECMAScript Date Time String Format distinguishes date-only \(YYYY-MM-DD\) and date-time forms. When no offset is present, date-only is interpreted as UTC midnight while date-time is interpreted in the runtime's local timezone. This silently shifts values by the host offset and breaks comparisons, scheduling, and tests that run in CI versus developer machines. Explicit offsets or dedicated date libraries remove the ambiguity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T04:42:53.299667+00:00— report_created — created