1. 24

  2. 12

    There’s a lot more falsehoods than that. POSIX defines days as exactly 86400 seconds and specifies that the relationship between Unix time and actual time-of-day is “implementation defined”. The meaning of dates prior to 1970 or negative Unix timestamps is explicitly undefined. The current number of seconds past the Epoch is specified using a formula in the standards document that makes no account for leap seconds, time smearing, or anything else.

    (Similarly useless specifications in POSIX include the dbm family of functions, which don’t actually require that more than one block of data be storable in the database at a time because they specifically allow for a hash function that causes all keys to hash to the same value…)

    It would be fun to create a UNIX that was basically useless but 100% conformant.

    1. 4

      As always, the proper solution would probably involve violence to astrophysicists.

      1. 5

        It’s a bit more nuanced than that. Astrophysicists don’t use leap seconds.

        The following section on the subject in Wikipedia is rather partisan in tone, but summarizes the recent debate to eliminate leap seconds:


        1. 2

          What event(s) happened that make that your default reaction?

          1. 4

            Have you ever met an astrophysicist??

            1. 1

              Only briefly, they seemed as nice as the other physicists I’ve met. Or do I not have a large enough sample size?

        2. 1

          Extending this beyond the Unix epoch domain - is there any OS-based timekeeping domain (Windows, the part of Mac that deals with their epoch) that deals with leap seconds internally, as opposed to handling them via NTP?

          I think the wider lesson is that if you’re developing things that really really rely on accurate time (civil or otherwise) you may have to rely on an external library.

          1. 0

            phk has been advocating the elimination of leapseconds for years. maybe it will finally happen.

            1. 3

              Thanks to @kivikakk for the link to Poul-Henning Kamp’s page.

              @feld, I’d appreciate it if there was less internal “jargon” in respect to people’s names etc. on Lobsters. Googling “phk” does not lead to Poul-Henning Kamp, but instead to a giant fund management firm. It’s easier for new arrivals here, as well as old-timers like me, if concepts are unambiguous.

              On the topic - based on this post, I think one of the issues that Kamp identifies is the lack of lead time and notification for coming leap seconds. Compared to another time/date related issue that’s much more widespread, namely DST changes, we can do better.

              1. 2

                Who or what is “phk”?

                1. 2