JavaScript · Senior · Question 73 of 75
What is a robust way to store and transfer dates?
- ✓Correct answer: As UTC instants (ISO 8601 strings or epoch ms), converting to the user's time zone only for display
- 2As local time strings like "25.10.2026 14:00"
- 3As
Dateobjects serialized withtoString()
Explanation
Local strings lose the time zone and break around DST changes. Intl.DateTimeFormat with timeZone formats for display; the Temporal API adds explicit time-zone-aware types.