UTC is Enough for Everyone, Right? (2018)
a year ago
- #time
- #programming
- #history
- The author, Zach Holman, shares his experience and challenges with building a calendar application, highlighting the complexities and edge cases involved in dealing with time.
- Time is described as a social construct with physicists debating its existence, making programming for time particularly challenging.
- A historical overview of timekeeping is provided, from ancient astronomical clocks to modern atomic and optical clocks, showing the evolution of time measurement.
- The standardization of timezones is discussed, including the political and economic factors that influence timezone changes, such as Samoa's decision to skip December 30, 2011, to align with trading partners.
- The difficulties of programming with timezones are emphasized, including the variability of timezone rules and the importance of using the Olson database for accurate timezone data.
- Best practices for storing and handling time in software are outlined, including the use of UTC, ISO 8601 for data interchange, and the importance of considering locale when displaying dates and times.
- The challenges of implementing recurring events in software are explored, with recommendations to keep initial implementations simple and to leverage existing standards like RFC 5545 for recurrence rules.
- Accessibility considerations for displaying time on the web are mentioned, such as using the `<time>` element with `datetime` attributes for machine-readable timestamps.
- The author concludes with advice to keep time-related code as simple as possible, to handle complex logic in the client when feasible, and to rely on established standards and libraries.