Live data from Hacker News

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

news.ycombinator.com

81–90 of 498 posts

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

#81
post #22

Earlier quoted context omitted.

Wikipedia says they are "the second largest retail company in the Nordic countries[citation needed]". Pretty big company anyway and embarrassing for them. Would love to learn more about what the bug was, but I guess they will never say. https://en.wikipedia.org/wiki/ICA_AB

Is that intended as a correction? It’s a different claim, as far as I can tell, and the data I could find points to ICA in fact being the largest supermarket chain in Sweden by turnover. https://www.esmmagazine.com/retail/top-5-supermarket-retail-...

No disagreement, just additional information.

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

#82
post #15

> A number of New Zealand petrol pumps stopped working on Thursday due to a "leap year glitch" in payment software, fuel stations and the payment service provider said. https://www.reuters.com/world/asia-pacific/leap-year-glitch-...

I'm sure it's more complicated than "we didn't think about leap years", but it certainly sounds pretty amateurish.

Old programmer rant: In my day, we fixed the Y2K bug - we went to the future and back several times a day!

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

#83
post #36

Python. cls = , data_string = 'Feb 29 04:55:03.687' format = '%b %d %H:%M:%S.%f' E ValueError: day is out of range for month

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)

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

#85
post #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.

Set up a backdated timeserver and use that to sync time

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

#86
post #24

Earlier quoted context omitted.

Same with my colleagues most recent top model Samsung Galaxy Watch :]

Odd, mine is showing the right date.

Are you sure? My F91W doesn't even ask for year in settings. How would have it known it is a leap year or not.

Some other models (not F91W) does track year.

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

#87
I am gald that in excel, deleting a day from March 1st automatically gives Feb 29 or 28 depending on the year in formula. Before that, I struggled a lot to find last day of month by tracking if its a leap year or not, and keeping an array of months & number of days. Now I simply add 1 to month, and from resulting daye I subtract 1 day. The Date value of that gives me 31 or 30 or 29 or 28.
Post reply on HN