Live data from Hacker News

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

news.ycombinator.com

111–120 of 498 posts

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

#111
post #89

Yup, all our rolling-year calculations failed because you can't have 29 Feb 2023!

These ones are the worst because you'd think they'd be so obvious at time of implementation. Maybe it's just me, I do a lot of comparisons and things like this always are top of mind for me.

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

#112
post #100
post #83

Earlier 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!

It wasn't. https://learn.microsoft.com/sl-SI/office/troubleshoot/excel/...

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

#114
post #74

I 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…

A simple fix would be to change it to a multiple of 4 (e.g. 124 years). Then it would fail every 100 years.

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

#116
post #98
post #28

Earlier 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.

Or do leap hours and have a 25 hour clock for a day

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

#117
post #11

The 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.

Wow, you're right.

>Calendar system: Auto-calendar set at 28 days for February [0]

[0] https://support.casio.com/en/manual/009/qw593.pdf

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

#118
post #27

Yes, Hesai LiDAR [1] bug is grounding cars. [1] https://pandaily.com/hesai-technology-addresses-lidar-produc...

Fascinating - why does a LiDAR involve the date?

For the survalence records

Telling base where, and when, you were

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

#119
I just checked and realized I have zero annual Stripe renewals that have come through so far today. Not a big surprise, since most of our customers are on monthly subscriptions.

I 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?

Post reply on HN