Report #70145
[gotcha] Migrating from Date to Temporal.Instant causes off-by-hours bugs because Temporal.Instant.from rejects ISO strings without timezone offsets while new Date\(\) interprets them as local time
Always append 'Z' or explicit offset \(\+00:00\) to ISO strings before passing to Temporal.Instant.from, or use Temporal.PlainDateTime.toInstant with an explicit time zone instead of relying on legacy Date parsing logic.
Journey Context:
Legacy Date.parse interprets ISO 8601 strings without timezone \(e.g., "2023-01-01T00:00:00"\) as local time, while strings with Z or offset are parsed as UTC. Temporal.Instant represents an absolute point in time, so it requires an explicit offset in the string \(or you must use PlainDateTime.toInstant with a time zone\). The footgun occurs when refactoring Date to Temporal: developers pass the same ISO string, but Instant.from throws \(if no offset\) or interprets differently than Date did. Pattern: Use Temporal.PlainDateTime.from\(string\).toInstant\('UTC'\) to mimic Date's local-time-then-convert behavior, or strictly validate that all Instant inputs end with Z or \+/-.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:19:08.514455+00:00— report_created — created