Heard from a friend in China: the age calculation portion of the app to schedule a marriage certificate had a bug where they subtracted 22 (legal minimum age) from the year, which resulted in 2002-02-29 which doesn't exist. The app intends to compare this against the user's birth date. The error handling code assumes all errors are from the comparison. The app then rejected all marriage certificate appointments by co…
so … many bullets were dodged today
Ask HN: Did you encounter any leap year bugs today?
181–190 of 498 posts
Re: Ask HN: Did you encounter any leap year bugs today?
#182Re: Ask HN: Did you encounter any leap year bugs today?
#183We have a product that uses ChatGPT via the API, using the 3.5 turbo version. Our query involves some dates. Instead of giving back text like it usually does, today it has been giving errors because it does not think 2024-02-29 is a valid date. This is easy to reproduce with the web interface, at least sometimes [0]. It start out by saying it's not a valid date and then as it's explaining why it isn't it realizes its…
Wired: LLM are practically AGI Tired: ChatGPT thinks February 29th isn't a valid date.
Re: Ask HN: Did you encounter any leap year bugs today?
#184Yes, I have a bot that posts daily San Francisco weather records to Mastodon. It did not post as scheduled today. This is because I am looking at all the high temperatures, low temperatures, and precipitation on today's date from 1875 (about as far back as there are digitized weather records I can work with) to the present. Since there was no such date as February 29, 1875 it is throwing an error.
I just dont get the “daily” weather records thing. Meteorologists talk about them constantly but theyre completely meaningless right? who cares what this particular day of the year highs were? its just noise! at least do it on a weekly resolution instead but even that seems so noisy itd be meaningless. sorry, this has nothing to do with you, just a pet peeve.
Compare that to something more mathematically rigorous: "Today is warmer than 98.72% of days between February 25th and March 5th". Nobody's going to click that link.
Re: Ask HN: Did you encounter any leap year bugs today?
#185My sister is staying in a hotel and all the keycards stopped working.
Re: Ask HN: Did you encounter any leap year bugs today?
#186The other way around! Today a few services that don't congratulate me on my birthday (on non-leap years) did. I was born on February 29th.
Re: Ask HN: Did you encounter any leap year bugs today?
#187One cleanup script broke because Python doesn’t have a clean way to subtract a year, and if you do now.replace(year=now.year-1), you get a ValueError when now is 2/29. It’s easy enough to address. There are various StackOverflow posts on such things. Here is one: https://stackoverflow.com/questions/54394327/using-datetime-...
> now.replace(year=now.year-1) Yeah but this is bad code. Python certainly does have a "clean" way to subtract a year, you subtract a datetime.timedelta object.
Re: Ask HN: Did you encounter any leap year bugs today?
#188Re: Ask HN: Did you encounter any leap year bugs today?
#189Yes, an amusing one: the Android app for the Berlin public transport, on the 29th, listed the results with the date of the previous day (28th). The funny thing is that the list is prefaced by a banner saying that this is a known bug, and the results actually refer to the 29th. Interesting way to workaround a bug :)