The other way around! Today a few services that don't congratulate me on my birthday (on non-leap years) did. I was born on February 29th.
Ask HN: Did you encounter any leap year bugs today?
91–100 of 498 posts
Re: Ask HN: Did you encounter any leap year bugs today?
#92My sister is staying in a hotel and all the keycards stopped working.
Re: Ask HN: Did you encounter any leap year bugs today?
#93Earlier quoted context omitted.
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?
#94Our ETL process is heavily monitored so we never miss a days data, but we got a surprising error "cant build aggregates - missing data, aborting MV refresh, data will be a day old". It was the year to date (YTD) calculation - no data for 29/2/2023 to compare to today.
Re: Ask HN: Did you encounter any leap year bugs today?
#95Earlier quoted context omitted.
What is your definition of "subtracting a year"? Seems like that's a relatively ambiguous operation without more specification.
Can you think of any situation where subtracting a year from today's date is ambiguous when today isn't, well, today?
'subtract a year' is imprecise and has many meanings, if what you want is 'same day, same month, previous year' then say that and do that, that's conceptually `date.year -= 1` not `date -= 1 year`, and will have this bug.
Re: Ask HN: Did you encounter any leap year bugs today?
#96Just hope the King of Sweden doesn't make another February 30. https://www.timeanddate.com/date/february-30.html
Re: Ask HN: Did you encounter any leap year bugs today?
#97Re: Ask HN: Did you encounter any leap year bugs today?
#98Just hope the King of Sweden doesn't make another February 30. https://www.timeanddate.com/date/february-30.html
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...
Re: Ask HN: Did you encounter any leap year bugs today?
#99Why are there so many stories about leap year bugs?
Re: Ask HN: Did you encounter any leap year bugs today?
#100Python. 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)
Edit: no it's not, it's absolutely correct, leap years just aren't as simple as I thought!