Report #54112
[gotcha] Date constructor interprets date-only strings as UTC but datetime strings without timezone as local time
Always use ISO 8601 format with explicit timezone offset \(e.g., '2023-01-01T00:00:00Z' or '\+05:00'\) or use a dedicated date library \(date-fns, luxon\). Never pass date-only strings \(YYYY-MM-DD\) to the Date constructor.
Journey Context:
ISO 8601 specifies that date-only strings should be interpreted as UTC midnight, while datetime strings without timezone are treated as local time. This creates a 12\+ hour discrepancy depending on the host timezone, causing production bugs that only appear when deployed to servers in different zones. Developers often assume both forms are treated consistently \(either both local or both UTC\) or don't realize the parsing rules differ.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:19:14.774372+00:00— report_created — created