Report #97286
[gotcha] Date.parse\('2024-01-01'\) and new Date\('2024-01-01'\) parse as UTC midnight, while new Date\('2024-01-01T00:00:00'\) parses as local midnight
Always include an explicit timezone offset or Z when parsing date strings, e.g. new Date\('2024-01-01T00:00:00Z'\), or parse date-only inputs manually with a library like date-fns-tz or Luxon.
Journey Context:
ECMAScript distinguishes date-only strings \(treated as UTC\) from date-time strings without an offset \(treated as local\). In negative-offset regions this silently shifts birthdays and deadlines by one day. Many developers assume the native parser is timezone-naive, but it is actually spec-defined. The safest fix is to avoid implicit parsing and keep calendar dates as explicit timestamps or timezone-aware objects.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:51:46.520692+00:00— report_created — created