Formatting dates
calendar components
The main way to format dates is to express them with appropriate calendar components, correct units and the correct time zone.
formatting APIs
We can format dates using Intl or Luxon.
the need for a timezone
An instant must be combined with a time zone to be translated to calendar components.
lack of a time zone in a JS Date
A JS Date doesn't store a time zone: we must read it from another source.
When the time zone is omitted, some formatting helpers fall back to the host machine's time zone, but:
- The host machine time zone doesn't necessarily match the event's time zone. In this case, it becomes impossible to read the event's local date and time on which it occurred.
- Even if the time zones match, there is no guarantee that the machine's time zone will remain fixed, thus it risks breaking the reading later on.