Temporal Data Types and Algorithms
Properly working with temporal data (i.e., dates and times) may appear straightforward, but, the further you dive into it, the further you realize how surprisingly complex it is. Here are just a few issues that come to mind:
- Some users measure time in the span of years; others measure in nanoseconds
- Some users ignore timezones; others need to coordinate events around the world
- Not every country has multiple timezones, even if they are wide enough to have them (e.g., China)
- Not every country observes daylight saving time; those that do cannot agree on when
- In countries that observe daylight saving time, not every region participates (e.g., Arizona in the United States (US))
- Different operating systems and versions time differently (see also the Year 2038 problem at https://en.wikipedia.org/wiki/Year_2038_problem)
These problems are really just the tip of the iceberg, and, in spite of all of the potential...