education-2022/ideas/time.md

3.1 KiB

  • Timezones
    • They are not always on the hour
    • Difference time offset and timezone
      • (locale stuff, formatting, DST transition dates, etc.)
  • Daylight savings
    • Days can be 23 or 25 hours long
    • Countries change their DST rules all the time
  • Dates, times, datetimes
    • Maybe you don't actually want to store full timestamps for literally everything
  • Time math is tricky
    • Adding 24 hours != adding one day (leap days / seconds)
  • Calendars
    • Historical calendars are very weird (kings just removing or adding days when they felt like it)
    • The calendar we use, and its extensions: Gregorian calendar, proleptic Gregorian calendar
    • Other calendars: Jewish calendar, Chinese lunar calendar (?), Hijiri
      • Primarily used for establishing holidays, but not really for common use any more (with the exception of China...?)
  • Computer clocks
    • CPU time vs. wall time
    • Monotonic clocks
      • Two kinds on Linux: one that smears forward, one that does not
    • Jiffies
  • Atomic clocks
  • NTP / chrony
  • Useful specs:
  • NOBODY USES ISO8601 STOP SAYING THAT THEY DO
    • NO ONE KNOWS WHAT IT IS
    • RFC3339 IS THE ONLY ONE ANYONE SHOULD USE
  • Accuracy of onboard clocks
    • Quartz oscillators - subject to drift
    • How to correct inaccurate clocks
  • Time smearing
  • Presentation and formatting?
  • The UNIX epoch, and the year 2038 problem
  • ISO "week date" (does this matter to anyone)
  • Falsehoods I think are actually important
    • "Always store time in UTC"
    • "Always store fully-qualified timestamps" i.e. datetimes with timezone, not just dates
    • "The smallest unit of time is X" (i.e. store the start and end of your time ranges precisely, never store 11:59:59)

You get a time you trust - then you work with it in some way (???)

How to use dates and times

Time accuracy / how to get accurate times

Fun tangents

East Asian countries treat birthdays differently: https://en.wikipedia.org/wiki/East_Asian_age_reckoning. In particular, Koreans (and others??) all celebrate their birthday on January 1, and start counting at 1 instead of 0.