Live data from Hacker News

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

news.ycombinator.com

11–20 of 498 posts

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

#14
post #2

Can't you just backdate some servers to confirm the fix?

Not directly related to leap year, but a couple weeks ago I set up a script for testing notification behavior that used libfaketime to simulate runs at different times.

I guess this might be less-trivial if you've got a distributed multi-service architecture and perhaps also depend on APIs that aren't under your control in the first place.

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

#16
There was one in the Phoenix Framework (Elixir) about issuing certificates with an invalid end date: https://github.com/phoenixframework/phoenix/issues/5737

Interestingly, Azure had this bug some years ago too leading to an outage. https://azure.microsoft.com/en-us/blog/summary-of-windows-az...

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

#18
post #4

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

What is your definition of "subtracting a year"? Seems like that's a relatively ambiguous operation without more specification.
Post reply on HN