• frezik@midwest.social
    link
    fedilink
    arrow-up
    9
    ·
    edit-2
    4 hours ago

    A common method of storing dates is the number of seconds since midnight on Jan 1, 1970 (which was somewhat arbitrarily chosen).

    A 32-bit signed integer means it can store numbers between 231 through 231 - 1 (subtracting one comes from zero being effectively a positive number for these purposes). 231 - 1 seconds added to Jan 1, 1970 gets you to Jan 19, 2038.

    The solution is to jump to 64-bit integers, but as with Y2K, there’s a lot of old systems that need to be updated to 64-bit integers (and no, they don’t necessarily have to have 64-bit CPUs to make that work). For the most part, this has been done already. That would put the date out to 292,277,026,596 CE. Which is orders of magnitude past the time for the sun to turn into a red giant.

    • pfm@scribe.disroot.org
      link
      fedilink
      arrow-up
      2
      ·
      3 hours ago

      Maybe it’s not LI5, but I certainly enjoy your explanation for including several important facts and context. I respect your skill and knowledge, dear internet stranger.

    • gandalf_der_12te@discuss.tchncs.de
      link
      fedilink
      arrow-up
      1
      ·
      3 hours ago

      midnight on Jan 1, 1970 (which was somewhat arbitrarily chosen).

      well not so much, as far as I remember the first end-user computers became available in 1971 or 1972 or something, and the internet also underwent some rapid developments in that time, so the date has a certain reasoning to it.