Excel incorrectly assumes that the year 1900 is a leap year

(learn.microsoft.com)

77 points | by susam 16 hours ago

12 comments

  • nippoo 16 hours ago
    In other "incorrect calendars" bugs, there's the Rockchip RK808 RTC, where the engineers thought that November had 31 days, needing a Linux kernel patch to this day that translates between Gregorian and Rockchip calendars (which are gradually diverging over time).

    Also one of my favourite kernel patch messages: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin....

    • tom_alexander 15 hours ago
      My favorite: For one day all the Microsoft Zunes froze for the entire day, only to recover on their own 24 hours later when the infinite loop in their leap year code had finally resolved: https://web.archive.org/web/20090313105752/http://www.zunebo...
    • gerdesj 16 hours ago
      To be fair, that's nowhere near as daft as september, october, november, december. Latin for seven, eight, nine, and ten is: septem, octem, novem, decem. Those are the nineth, 10th, 11th and 12th months.

      Edit: Whoops, correct eng -> latin nums

      • emmelaich 15 hours ago
        You may know this but originally they were 'correct' because the start of the year was March.
        • teraflop 15 hours ago
          Which wouldn't be that weird, except that the earliest Roman calendar started in March and ended in December, having only 10 months!

          The Romans were of course well aware that this left a gap of about two months between the end of one year in December, and the beginning of the next year in March. But they just didn't bother counting this period as part of the calendar year. Presumably because there was no agricultural reason to need accurate dates during winter.

          • shakna 14 hours ago
            Numa did try to name and consolidate the winter months, but it wasn't very popular.

            The months were for productive seasons, winter for everything else.

            • sam_lowry_ 8 hours ago
              Also French revolutionaries ;-)
              • rkomorn 8 hours ago
                I'm French and occasionally like to (re)read about the revolution period and every time I come to the calendar stuff I can't help but think "Really? This was stuff we wanted to spend time on?"
          • rsynnott 8 hours ago
            AIUI, there is some confusion over whether this is actually the case. The pre-Julian calendar had 12 months, plus an optional intercalated month (they were aware that their ‘year’ had the wrong number of days, and periodically shoved in some extra time to patch it up). The 10 month calendar, if it existed, would have been very early and there’s not much hard evidence that it was actually used. Numa Pompilius, who was allegedly responsible, is a mythical figure and probably not an actual historical king.
      • _kst_ 14 hours ago
        "I hate that SEPTember OCTOber NOVember and DECember aren't the7th, 8th, 9th, and 10th months."

        "Whoever f---ed this up should be stabbed."

        "I have excellent news for you."

      • caminante 14 hours ago
        No? How is it octem and not octo? Does the flat bar accent do something?

        >The Latin word for "eight" is octō. [0]

        [0] asked google

  • scrlk 16 hours ago
    An interesting read related to this bug from Joel Spolsky - My First BillG Review: https://www.joelonsoftware.com/2006/06/16/my-first-billg-rev...
  • jdlyga 13 hours ago
    Excel is so embedded into our world that we renamed part of the human genome to prevent excel from incorrectly reading them as dates

    https://www.theverge.com/2020/8/6/21355674/human-genes-renam...

  • eviks 13 hours ago
    > If this behavior were to be corrected, many problems would arise, including: > Almost all dates in current Microsoft Excel worksheets and other documents would be decreased by one day.

    Unless your fix adds a day to make them stay the same??

    And these silly "compatibility" excuses are begins bugs affecting more and more unsuspecting users like that gene import conversion bug affecting a quarter of all published gene research papers.

  • darknavi 16 hours ago
    > Applies to: Microsoft Excel for Mac 2011, Excel for Microsoft 365 for Mac, Microsoft Office Excel 2003, Microsoft Office Excel 2007, Excel 2010, Excel 2013, Excel 2016
    • parenthesis 15 hours ago
      What about Microsoft 366?
      • a012 15 hours ago
        Although it is technically possible to correct this behavior so that current versions of Microsoft Copilot 366 is a leap year, the disadvantages of doing so outweigh the advantages.
    • etothepii 16 hours ago
      This will never stop as it would require either the reference date to be changed or fir all dates in all saved spreadsheets to be off by one.
      • zvr 3 hours ago
        IIRC, it will never stop because now it has been "standardized". The OOXML specification explicitly mentions that the conversions of dates and their attributes (like whether a year is a leap one) has to follow the Excel implementation.
      • gpm 14 hours ago
        Or... A version number that tells excel which convention to use?

        I suppose that would make copy and pasting formulas between spreadsheets very mildly error prone though, so it probably won't happen.

  • Lammy 13 hours ago
    I learned about this from my Macintosh back in The Day™, when a dead Parameter RAM battery would reset the system date to January 1st, 1904 at every boot:

    - https://spinsidemacintosh.neocities.org/im202#im033-001

    > “The date and time setting is also copied at system startup from the clock chip into its own low-memory location. It’s stored as a number of seconds since midnight, January 1, 1904, and is updated every second. The maximum value, $FFFFFFFF, corresponds to 6:28:15 AM, February 6, 2040; after that, it wraps around to midnight, January 1, 1904.”

    - https://archive.org/details/mac_Macworld_Mac_Secrets_5th_Edi...

    - http://preserve.mactech.com/articles/develop/issue_26/minow....

    - https://preterhuman.net/macstuff/qa/ops/ops23.html

  • jwrallie 12 hours ago
    I was developing an interface to read a .xslx file to import a table within a Qt/C++ program, and this detailed showed up in my conversions to Unix time. It turns out Claude was amazing and brought up this issue as soon as Excel was mentioned, but terrible at actually fixing up the calculations.

    I'd prefer using a .csv with dates already converted to Unix time, but no luck convincing the other people involved.

    • jagged-chisel 6 hours ago
      You should export datetimes as human-readable strings. Helps debugging. (And does nothing to guarantee they’re correct, just like every other attempt at a solution.)
  • ComputerGuru 13 hours ago
    This obligates me to share this absolute gem of date/time history folklore: https://neosmart.net/forums/threads/an-extended-history-of-t...
    • netsharc 8 hours ago
      Awesome.

      This is from before ChatGPT or Google were around. So this person either knew their stuff or typed it up from an encyclopedia...

  • antisol 7 hours ago
    Aah, this old thing. Pops up every decade or so.

    Reminds me of the good old "Falsehoods programmers believe about time": https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b...

  • shablulman 15 hours ago
    [dead]
  • stainlu 13 hours ago
    [flagged]