Live data from Hacker News

Ask HN: Did you encounter any leap year bugs today?

news.ycombinator.com

401–410 of 498 posts

Re: Ask HN: Did you encounter any leap year bugs today?

#401
Not today but several years ago while lending a hand on a project that was wildly overdue and the guys needed all the help they could get. Disclosure: it was not in software that was in production yet(otherwise you would have likely heard and been affected by it by now I suspect). The software's purpose was dealing with commercial airlines - routes, connections and all that. The travelling salesman problem basically. The software was meant to replace an antique system which no one knew how to maintain since in 2020 it was still running on mainframes and written in fortran. There were specifications on how the system worked but there was no one who could even read the code. Anyhow, the way dates were stored, read and calculated was absolutely insane. I can't recall what the exact deal was, but each date was represented with either 4 or 5 bytes with some really awkward algorithm to make it into something meaningful. With a bunch of additional patches surrounding Y2K.

Unfortunately it was a lot more subtle than getting March 1-st instead of Feb 29-th. Each date was calculated with a dynamic offset depending on the month and year. So during leap years, everything was fine until the 14-th of May at 01:00 UTC. The second the clock hit, 14-th of May at 01:01, all hell broke loose incrementally as time want on until the end of each year. The weird string representation for Nov 1-st was being calculated as January 3-rd for instance. But as soon as the clock hit January 1-st, everything went back to normal. It took 6 people 2 days to figure it out. As you might expect, this was not mentioned anywhere in the documentation.

I'm not sure what has happened ever since, but if the system made it into production and you didn't get stuck in an airport... You're welcome lol

Re: Ask HN: Did you encounter any leap year bugs today?

#405
post #207

Earlier quoted context omitted.

My favorite prompt: asking "How many e's are there in the word egregious". Always says three (ChatGPT 3.5, 4, 4 turbo). When you ask it which three, it realizes its mistake and apologizes (or sometimes tells you where they are that is completely wrong). Looks like it just outputs gibberish for these things.

ChatGPT is specifically bad at these kinds of tasks because of tokenization. If you plug your query into https://platform.openai.com/tokenizer , you can see that"egregious" is a single token, so the LLM doesn't actually see any "e" characters -- to answer your question it would have had to learn a fact about how the word was spelled from it's training data, and I imagine texts explicitly talking about how words are s…

Chatgpt could say “I don’t know”

Re: Ask HN: Did you encounter any leap year bugs today?

#406
post #22

One of the largest food store chains in Sweden had their entire card payment go down because someone forgot to handle leap years!

Wikipedia says they are "the second largest retail company in the Nordic countries[citation needed]". Pretty big company anyway and embarrassing for them. Would love to learn more about what the bug was, but I guess they will never say. https://en.wikipedia.org/wiki/ICA_AB

Tbh I was just too lazy to find its place in the rankings. It sure is a big business anyway

Re: Ask HN: Did you encounter any leap year bugs today?

#408

Why this is not a global holiday? Let's all come together and agree to do nothing on this bonus day. Calendar Problems solved.

We should get it off work. We aren't getting paid for the extra day of work right?

No power, no hospitals, no internet, no phones, no care homes etc.

Re: Ask HN: Did you encounter any leap year bugs today?

#409
My (cheap, digital) watch thought it was 1st of March.

Funnily enough when I went to change the date the watch allowed me to select Feb 29th. I wondered if it had supports for leap year and it was off by exactly one year but that's unlikely as it didn't seem like cycling through the dates changed it to 29. Most likely it allows selecting manually the 29th but then skips from 28th to 1st of March every year.

All my billing / calendar booking is outsourced to Paddle / Stripe / third parties so no other issues in my products!

Post reply on HN