Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 18 submissions in the queue.
posted by hubie on Saturday March 02 2024, @02:28PM   Printer-friendly

https://www.theregister.com/2024/02/29/fuel_pump_leap_year_bug/

Today is February 29, an unusual day in that it is added to the common 28 in years that are multiples of four to keep the calendar in sync with the astronomical year.

This kludge prevents our seasons from drifting out of whack, but it presents a problem for computers and software, which have to be programmed to account for the extra day to avoid error conditions and incorrect data.

We are all using a computer of one sort or another to read this and hopefully nothing has caught fire, yet every leap year, something somewhere falls over hard.

In New Zealand, which has a head start on most of the world, it was payment systems at fuel pumps that have just staggered back to their feet after a nationwide outage lasting more than ten hours.


Original Submission

This discussion was created by hubie (1068) for logged-in users only, but now has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
  • (Score: 3, Interesting) by looorg on Saturday March 02 2024, @02:56PM

    by looorg (578) on Saturday March 02 2024, @02:56PM (#1347073)

    Same thing happened here. ICA, largest grocery chain in the Scandinavia, couldn't accept card payments for most of the day. One would assume this "error" would have been handled and fixed a long time ago, since it's not exactly a new thing. But I guess they forgot to implement or spec for that when they built their latest whizbang system. Weird thing is that I have this nagging memory from the past that ICA built the backend of their system in COBOL so it should be working or having been fixed decades ago. I guess it was a frontend problem then.

  • (Score: 2, Insightful) by Anonymous Coward on Saturday March 02 2024, @03:08PM (5 children)

    by Anonymous Coward on Saturday March 02 2024, @03:08PM (#1347074)

    It's not a "kludge."

    • (Score: 3, Interesting) by pTamok on Saturday March 02 2024, @04:01PM

      by pTamok (3042) on Saturday March 02 2024, @04:01PM (#1347079)

      Agree.

      But the average person-in-the-street doesn't appreciate the (almost) complete decoupling of the rotation of the earth about its axis (which is what generates the day length*) from the orbit of the Earth around the barycentre of the Earth-Sun system (which gives us the length of the year).

      I'm still getting my head around the physical reasons for the 'precession of the equinoxes'** - most 'explainers' describe what happens, without detailing why it happens.

      I have a huge amount of respect for early astronomers like Hipparchus, Claudius Ptolemy, al-Battani, and Tycho Brahe.

      *Blow minds with the difference between the sidereal day and the mean tropical day, and why the mean tropical day is an average, and what an analemma is.
      **So we get the difference between the sidereal year and the tropical year. Fun.

    • (Score: 5, Insightful) by mcgrew on Saturday March 02 2024, @06:20PM (3 children)

      by mcgrew (701) <publish@mcgrewbooks.com> on Saturday March 02 2024, @06:20PM (#1347100) Homepage Journal

      I'm amazed at today's INCOMPETENT coders. Mod me as you wish, but there is a clock in France that was made in the seventeenth century that keeps the time and date, including leap days, and has done so for hundreds of years. Purely mechanical. But you dimwits can't do it with a 21st century computer!

      Of course, today's corporations are too GOD DAMNED CHEAP to hire competence.

      --
      We are all S/Ners here
      • (Score: 3, Informative) by Tork on Saturday March 02 2024, @10:24PM

        by Tork (3914) Subscriber Badge on Saturday March 02 2024, @10:24PM (#1347141)
        You know what's sad? To this day I do not trust my iPhone's alarm on time change days. They've had at least two mishaps where the alarms failed to go off (circa 2012 if memory serves) and a third incident where alarms didn't go off on New Year's Day... right after airing an ad featuring a famous tennis player touting their do-not-disturb mode. To my knowledge it has been a problem in more than five years, but I can't get over how elementary and welll-known this problem is. I've written code, in BASIC, in High School specifically dealing with both time change and leap year considerations. We even went into certain exceptions to leap years... tho my memory has faded, something like first year of the century doesnt count. I'm almost certain I didn't get that quite right, sorry, but my point is if I was exposed to this in the 90's I can't fathom a company like Apple messing it up so badly.

        Problems that shouldn't be problems. 🙄
        --
        🏳️‍🌈 Proud Ally 🏳️‍🌈
      • (Score: 4, Interesting) by SomeGuy on Sunday March 03 2024, @12:55AM (1 child)

        by SomeGuy (5632) on Sunday March 03 2024, @12:55AM (#1347154)

        It happens all the time.

        Program specs are written by someone in Marketing, who has no understanding of the business requirements. They give that to someone in India, because the idea of giving that to someone in the US never even occurs to them. The programmer is only given 5 seconds to crank out some code, which is for some mysterious unknown reason is completely unusable. It is written in whatever is the absolute worst tool for the job (IA, Cloud, Java, XML, whatever). It gets kicked back and forth until the program looks pretty enough to make the marketing department happy. Then it finally gets put in front of the users who are blamed as "uncooperative" and "turning up their nose at it", because it is complete gibberish. Each step of the way a different programmer is assigned to it and has to learn everything about it all over again. Then after years of "teething issues" it kind of sort of starts working.

        Only now it must communicate and share data with a dozen other internal and external enterprise systems. All of which have different data semantics, different software environments, different data transfer tools, and so on. So now there is a constant flow of totally corrupt data, and little internal groups and bureaucracys pop up around users trying to fix the data without making the drooling retarded higherups look bad. You want field A to match in all systems? Submit a form to group W. Need field B changed, that originates in another system? file a change request with User Care group T. Need field C to have any kind of information? Hunt down mysterious the Tier F system group.

        All the while, nobody wants to spend money on fixing any of it, not to mention they would have to admit they never documented a single business requirement, not that it matters as the business requirements are completely different now and the end users are still doing all their real work in Microsoft Excel spreadsheets.

        I'm honestly surprised all the clocks in the world aren't flashing "12:00", like in Idiocracy.

        It's surprising that ANYTHING works any more. Nobody wants to hire or retain permanent internal employees that can actually learn the systems, become experts, and keep things running smoothly. It looks better on manager's resumes to say they handled a bunch of crisises!

        • (Score: 1) by pTamok on Sunday March 03 2024, @12:06PM

          by pTamok (3042) on Sunday March 03 2024, @12:06PM (#1347202)

          I hope it is satire.

          I fear it is the truth.

  • (Score: 2, Interesting) by jelizondo on Saturday March 02 2024, @03:41PM (11 children)

    by jelizondo (653) Subscriber Badge on Saturday March 02 2024, @03:41PM (#1347078) Journal

    Forbes reports [forbes.com.mx] that one of the largest banks in Mexico is down due to "technical problems"(in Spanish)

    Hard to imagine tech failing on payday just because some Pope changed the calendar a thousand years ago!

    • (Score: 2, Informative) by pTamok on Saturday March 02 2024, @04:10PM (8 children)

      by pTamok (3042) on Saturday March 02 2024, @04:10PM (#1347080)

      AFAIK, Julius Caesar wasn't a pope. It was under his rule that the Roman calendar was revised to use leap days. Before then, they had leap months. But as a programmer, be glad you are not dealing with bissextile days [wikipedia.org].

      • (Score: 3, Funny) by janrinok on Saturday March 02 2024, @04:15PM (4 children)

        by janrinok (52) Subscriber Badge on Saturday March 02 2024, @04:15PM (#1347084) Journal

        Careful, some right winger will be calling you out for supporting transvestites or something, at least until he looks the word up.....

        --
        I am not interested in knowing who people are or where they live. My interest starts and stops at our servers.
        • (Score: 3, Troll) by mcgrew on Saturday March 02 2024, @06:24PM (2 children)

          by mcgrew (701) <publish@mcgrewbooks.com> on Saturday March 02 2024, @06:24PM (#1347101) Homepage Journal

          Republicans looking anything up? Today's Republicans? TRUMP Republicans???

          BWAHAHAHAHAHA!!!!

          --
          We are all S/Ners here
          • (Score: 2) by captain normal on Saturday March 02 2024, @06:58PM

            by captain normal (2205) on Saturday March 02 2024, @06:58PM (#1347110)

            Yep...now that is a real oxymoron.

            --
            The Musk/Trump interview appears to have been hacked, but not a DDOS hack...more like A Distributed Denial of Reality.
          • (Score: 5, Funny) by sjames on Saturday March 02 2024, @07:09PM

            by sjames (2882) on Saturday March 02 2024, @07:09PM (#1347114) Journal

            Even if they DO look it up, all we'll get is a song and dance about how Joe Biden conspired with the dictionary publishers to make them look stupid.

        • (Score: 1) by pTamok on Saturday March 02 2024, @09:01PM

          by pTamok (3042) on Saturday March 02 2024, @09:01PM (#1347132)

          I thought they were more worried about transsexuals than transvestites, but then again, given the confusion between paediatricians and paedophiles, you are most likely correct, especially as drag-queens are being regarded as unacceptable in some places. I wonder how long it will be until women are banned from wearing items of male apparel, like trousers. A man wearing a kilt or a fustanella is likely to be suspect, too.

      • (Score: 2) by tangomargarine on Saturday March 02 2024, @04:19PM (1 child)

        by tangomargarine (667) on Saturday March 02 2024, @04:19PM (#1347085)

        Well, now that I think about it, Julius Caesar *was* Pontifex Maximus [wikipedia.org], i.e. high priest of Rome, the office of which was responsible for maintaining their calendar. So if you squint hard enough...

        He was 2 millennia ago not 1 though.

        --
        "Is that really true?" "I just spent the last hour telling you to think for yourself! Didn't you hear anything I said?"
        • (Score: 1) by pTamok on Saturday March 02 2024, @04:37PM

          by pTamok (3042) on Saturday March 02 2024, @04:37PM (#1347088)

          Acknowledged. Nicely pointed out.

          Mind you, with that squint, your pupils will be facing each other, and you'll be looking into the depths of your own soul.

          Of course, as the Earth's rotation is slowing down, at some point the year will be an integer number of days again, and the problem goes away for a while. Around 600 million years ago the day length was roughly 21 hours. The rate of slowing isn't linear, so it's difficult to predict when that might be.

      • (Score: 2) by jelizondo on Sunday March 03 2024, @05:57PM

        by jelizondo (653) Subscriber Badge on Sunday March 03 2024, @05:57PM (#1347224) Journal

        From Wikipedia: [wikipedia.org]

        In practice, particularly during the late Republic, the office of pontifex maximus was generally held by a member of a politically prominent family. It was a coveted position mainly for the great prestige it conferred on the holder. Julius Caesar became pontifex in 73 BC and pontifex maximus in 63 BC.

        Pontifex Maximus translates into supreme pontiff, or in vernacular, supreme pope. So, Julius was indeed a Pope. QED

        BTW, the current title of Pope in the Catholic Church is directly taken from the Roman Empire religion.

    • (Score: 2) by tangomargarine on Saturday March 02 2024, @04:13PM (1 child)

      by tangomargarine (667) on Saturday March 02 2024, @04:13PM (#1347081)

      Which pope a thousand years ago? The Julian Calendar was 46 BC and Julius Caesar wasn't a pope (obviously), and Gregorian Calendar was 1582, a little under half a millennium ago.

      --
      "Is that really true?" "I just spent the last hour telling you to think for yourself! Didn't you hear anything I said?"
  • (Score: 2) by DadaDoofy on Saturday March 02 2024, @04:14PM (11 children)

    by DadaDoofy (23827) on Saturday March 02 2024, @04:14PM (#1347083)

    What kind of programmer in modern times would not be using the built-in date functions in whichever framework they are using? If the software is so old the date routines were hand-rolled, there are likely other potentially more serious issues that need to be addressed.

    • (Score: 1) by pTamok on Saturday March 02 2024, @04:49PM (1 child)

      by pTamok (3042) on Saturday March 02 2024, @04:49PM (#1347093)

      The built-in functions likely work fine, but whether they are used correctly is a different point.

      For example, setting up a drop-down list that allows only for days up to 28 in February. The 29th might be a valid date, but if it can't be chosen, the end-user has a problem. In principle, a standardised date-picker might be available, but that is separate to the routines used to validate dates and do calculations with dates, which are far more likely to exist.

      I have been forced to use some pretty horrific date-pickers in my time. The ones that allow 'free text', but assume American date format (MM-DD-YYYY) as input are always fun.

      • (Score: 2) by Freeman on Monday March 04 2024, @07:41PM

        by Freeman (732) on Monday March 04 2024, @07:41PM (#1347340) Journal

        I was playing with dates in a python script recently and noted the issue of Leap Year. Thankfully, it was easy enough to handle with built-in functions. Doing things by hand, because "a text editor is all I need" is just doing things the hard way. While I do love a text editor as well as the next guy. I much prefer Notepad++ over any of the built-in text editors I've had the displeasure of using in any OS. (Small caveat for vi/vim, and never emacs.) Beyond that, having an "intelligent" IDE is awesome. I've been using PyCharm for quite a while and have been rather pleased with it. While I could make more use of some features, I'm still very much on the hobbyist side of things.

        --
        Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
    • (Score: 4, Funny) by turgid on Saturday March 02 2024, @05:33PM (3 children)

      by turgid (4318) Subscriber Badge on Saturday March 02 2024, @05:33PM (#1347096) Journal

      And what idiot hand-rolls date functions and doesn't account for leap years? Wait, I think I know...

      • (Score: 2) by DadaDoofy on Saturday March 02 2024, @06:01PM (2 children)

        by DadaDoofy (23827) on Saturday March 02 2024, @06:01PM (#1347098)

        Date and time calculations are in fact a lot more complicated than most people realize. At my first job as a mainframe FORTRAN and COBOL programmer, I had to write a routine that converted Pacific Time to Eastern Time. It became a labor of love, and I even accounted for the edge case descibed below, so it would work correctly from midnight to 3AM on March 1 in both 2000 (leap year) and 2100 (not leap year). Of course, maybe I was somewhat naive in 1983 to think the code would possibly still be in use by 2000, let alone 2100!

        If a year is divisible by 100, but not 400, then it is not a leap year. If a year is divisible by both 100 and 400, then it is a leap year.

        • (Score: 2, Interesting) by pTamok on Saturday March 02 2024, @08:50PM (1 child)

          by pTamok (3042) on Saturday March 02 2024, @08:50PM (#1347128)

          I agree about the complexity.

          There is this canonical falsehoods text: Falsehoods programmers believe about time [github.com] which would be helpful if it gave examples of why each falsehood is incorrect.

          In addition, this is an interesting article about how calendars become less useful as one gos back in time: Making 'time' safe for historians [quirksmode.org]

          So the dates 1st February, 1918 to 13th February, 1918 don't exist in Russia. But 30th February, 1712 did exist in Sweden. And in England, leap days were added by repeating February 24th, but counting it as only a single day - that was only formally changed in 1750. Thankfully, most programmers don't have to deal with all that. However, there are enough different calendar systems in current use in the world that truly international software has challenges. Not least: the formal definition of the start of the Muslim holy month of Ramadan means that the start day can vary by geography as it depends on sighting the new moon, which can vary by longitude - New moon on the horizon: An astronomer's guide to solving the start of Ramadan [natureasia.com].

          • (Score: 2) by Freeman on Monday March 04 2024, @07:47PM

            by Freeman (732) on Monday March 04 2024, @07:47PM (#1347342) Journal

            That falsehoods list could easily be labeled, x reasons why programming is hard.

            --
            Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
    • (Score: 3, Informative) by Common Joe on Sunday March 03 2024, @10:30AM (3 children)

      by Common Joe (33) <{common.joe.0101} {at} {gmail.com}> on Sunday March 03 2024, @10:30AM (#1347183) Journal

      It gets worse. Not all major platforms can handle dates correctly. In this case, I'm specifically talking about Python [bovenberg.net]. Makes me wonder what others languages / frameworks that are out there that are broken.

      • (Score: 4, Interesting) by pTamok on Sunday March 03 2024, @12:03PM (1 child)

        by pTamok (3042) on Sunday March 03 2024, @12:03PM (#1347201)

        Many.

        This include Microsoft Windows assuming (by default, although it is changeable by adding a Registry setting) that the hardware Real Time Clock (RTC) is set to local time. Linux assumes it is set to UTC. This, amongst other things, causes problems for dual-booting systems.

        There is, however, a more fundamental problem, which is that UTC does not flow smoothly - it (currently) has leap seconds, which are not handled well by current computing infrastructure.

        Leap seconds are traditionally added either on June 30 or on December 31. They occur at the end of the day, just before the clock ticks over to midnight. On a digital clock, a leap second reads 23:59:60 or 11:59:60 pm.

        Quoted from timeanddate.com

        So YYYY-06-30T23:59:60 is a valid time for some years, as is YYYY-12-31T23:59:60, which breaks a lot of assumptions.

        This is partly why some people campaign for a time standard that is well-behaved and does not have leap seconds. It is also entirely possible that UTC cold need to be adjusted in the other direction in future (if the Earth's rotation speeds up, which it has done recently), so we'll need to drop a second. Which means that the second 23:59:59 would be removed on one of those two dates - it would be an invalid time.

        https://engineering.fb.com/2022/07/25/production-engineering/its-time-to-leave-the-leap-second-in-the-past/ [fb.com]
        https://www.ntp.org/reflib/leap/ [ntp.org]

        Even if we had a timescale that ticked SI seconds continuously, with no steps, we would still have problems as a result of relativity. It is reasonably well known that clocks at different gravitational potentials tick at different rates - time literally flows more slowly at high gravitational potential. For this reason, the Earth's core is estimated to be roughly two-and-a-half years younger than the Earth's surface ( The young centre of the Earth [arxiv.org]. So an atomic clock, ticking SI seconds in the basement of a building will tick more slowly than an identical clock ticking SI seconds in the attic of the same building. The effect is real, and height differences of a few millimetres can be seen experimentally ( https://www.sciencenews.org/article/atomic-clock-general-relativity-time-warp-millimeter-physics [sciencenews.org] and https://www.sciencenews.org/article/everything-really-relative [sciencenews.org] and https://www.scientificamerican.com/article/time-dilation/ [scientificamerican.com] )

        A height difference of 33 centimetres gave a time difference of 90 nanoseconds in 79 years, or very roughly, a nanosecond per year (Another calculation, for a height difference of 10 metres gives a difference of about 0.66 nanoseconds per week). For most people, having computer clocks differ by that much isn't material, but...GPS has to take the effect into account. Once you know about the effect, you can calculate around it, and set your time standard to be a notional clock ticking in a known gravitational potential, then apply the relevant corrections to actual clocks. This is demonstrated by the time standards known as Barycentric Dynamical Time [wikipedia.org] and Barycentric Coordinate Time [wikipedia.org]

        So you end up knowing that if you use a physical clock, it will inevitably drop out of synchronisation with another physical clock that is moving relative to the first, or just sitting in a different gravitational potential, or both. You can apply mathematical corrections, which will mean needing to adjust the time on one or both of the systems, which is what you were trying to avoid in the first place with a smoothly flowing time standard. The universe is telling you that you need to deal in practice with discontinuous time, no matter what. Sigh.

        • (Score: 2) by janrinok on Sunday March 03 2024, @12:56PM

          by janrinok (52) Subscriber Badge on Sunday March 03 2024, @12:56PM (#1347203) Journal

          I found this fascinating - even though it was not something entirely new. There isn't a 'Fascinating' moderation so you will have to make do with 'Interesting'.

          --
          I am not interested in knowing who people are or where they live. My interest starts and stops at our servers.
      • (Score: 2) by Freeman on Monday March 04 2024, @07:45PM

        by Freeman (732) on Monday March 04 2024, @07:45PM (#1347341) Journal

        In dealing with dates recently in Python, I ended up using the calendar module to acquire the correct date accounting for leap year. https://docs.python.org/3/library/calendar.html [python.org]

        --
        Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
    • (Score: 0) by Anonymous Coward on Sunday March 03 2024, @03:51PM

      by Anonymous Coward on Sunday March 03 2024, @03:51PM (#1347214)

      Um, the kind working a shitty Agile project where they are given an hour to get it done.

  • (Score: 2, Interesting) by Anonymous Coward on Saturday March 02 2024, @11:34PM

    by Anonymous Coward on Saturday March 02 2024, @11:34PM (#1347150)
    The older people retired or were laid off and the noobs are coding unsupervised now?
  • (Score: 1, Insightful) by Anonymous Coward on Sunday March 03 2024, @03:48PM

    by Anonymous Coward on Sunday March 03 2024, @03:48PM (#1347213)

    It's not the tech. It's crappy coders that can't even get the basics right.

(1)