Yup, all our rolling-year calculations failed because you can't have 29 Feb 2023!
Ask HN: Did you encounter any leap year bugs today?
111–120 of 498 posts
Re: Ask HN: Did you encounter any leap year bugs today?
#112Earlier quoted context omitted.
As mentioned by sibling comments, it's because you're not specifying a year. If you change the day to the 28th you'll see that it defaults to the year 1900: >>> datetime.strptime('Feb 28 04:55:03.687', '%b %d %H:%M:%S.%f') datetime.datetime(1900, 2, 28, 4, 55, 3, 687000) >>> datetime.strptime('Feb 28 13:37:06.942', '%b %d %H:%M:%S.%f') datetime.datetime(1900, 2, 28, 13, 37, 6, 942000)
That makes it weird though, because 1900 was a leap year? I sort of get it, but it's a slightly odd and inconsistent decision. Edit: no it's not, it's absolutely correct, leap years just aren't as simple as I thought!
Re: Ask HN: Did you encounter any leap year bugs today?
#113They had to switch to cash.
Re: Ask HN: Did you encounter any leap year bugs today?
#114I certainly did. There is a batch process to cull old records. It checks for customers who do not have a date of death recorded but are > 130 years old, as it assumes that we weren't informed of their death. It takes 130 years from the current date and uses that in an SQL statement to compares it to the date of birth. DB2 doesn't like 1894-02-29. Apparently it happens every 4 years, but no-one can be bothered to fix…
Re: Ask HN: Did you encounter any leap year bugs today?
#115Yes, Hesai LiDAR [1] bug is grounding cars. [1] https://pandaily.com/hesai-technology-addresses-lidar-produc...
Re: Ask HN: Did you encounter any leap year bugs today?
#116Earlier quoted context omitted.
Let's just be happy that it isn't still the day after February 24 that becomes the inserted leap day. https://www.isof.se/lar-dig-mer/kunskapsbanker/lar-dig-mer-o...
We should just do what we do for time changes and do feb 28 over again.
Re: Ask HN: Did you encounter any leap year bugs today?
#117The Casio F-91W doesn’t account for the year, it showed today’s date as Thursday, March 1st.
That's more of a design decision than a bug. It's intentional to make the product cheaper. The manual does mention it.
>Calendar system: Auto-calendar set at 28 days for February [0]
Re: Ask HN: Did you encounter any leap year bugs today?
#118Re: Ask HN: Did you encounter any leap year bugs today?
#119I have wondered about how Stripe handles months with differing numbers of days (for monthly subs), and leap years (for annual subs). Do they accelerate renewals in short months, so that February 28 has all the renewals that normally happen on the 29th-31st of other months? Or do they happen on March 1?