Happy Test Your Leap Year Handling In Production Day to all the software that was written in the last 1460 days.
@futzle Just spent some time this morning fixing "ValueError: day is out of range for month"
Andrew Feeney (@[email protected])

Is the test failing because it's a leap day? #ObliqueDebuggingStrategies

PHP Community on Mastodon
@andrewfeeney @futzle The best thing was that I even fixed a similar date math issue yesterday but didn't audit the code base to see what would fail today. :)
@spi @futzle The test I fixed chose an arbitrary future date using the hardcoded year 3000 and today’s date. It would have been fine if 3000 was a leap year, which it appears to be at first glance being divisible by 4 but is not because it’s divisible by 100 but not 400.

@spi @futzle Nobody's life depends on this code, and the idea that it will still be running in almost 1000 years is laughable, but this got me wondering.

What terrifying date-based bugs are lurking in code which lives depend on, that's running beyond the careers (or lifespans) of the original developers?

"This will break in 50 years, but they'll have rewritten this by then."

There's obvious ones like unix epoch stuff etc, but there must be so many more individual cases.

@andrewfeeney @futzle My fix was in product code, it was calculating a 3 year processing window but didn't account for leap years.

It does make one ponder about really horrible date-based bugs that are lurking, I can only hope that such systems have more extensive testing.