Report #98259
[gotcha] Date.parse and the Date constructor interpret date-only strings as UTC but datetime strings as local time
Always include an explicit timezone offset in ISO strings \(e.g. 2024-01-01T00:00:00Z or \+00:00\) when parsing, or construct dates explicitly with Date.UTC\(year, month, day\) when you want UTC. Never pass a bare date string like 2024-01-01 and assume local time.
Journey Context:
The ISO 8601 profile used by JS says YYYY-MM-DD is date-only \(UTC\), while YYYY-MM-DDTHH:mm:ss is local if no offset is given. This trips up scheduling and billing code that parses API responses. Common wrong fixes include adding/subtracting getTimezoneOffset\(\) minutes, which breaks around DST. The robust pattern is to treat date strings as data and convert with an explicit offset or UTC constructor.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:39:59.636556+00:00— report_created — created