Earlier quoted context omitted.
ChatGPT thinks today is March 1. Go ahead and ask it what today’s date is.
> No, 2024 is not a leap year. Leap years are years divisible by 4, except for years that are divisible by 100 unless they are also divisible by 400. Therefore, the next leap year will be 2024.
Ask HN: Did you encounter any leap year bugs today?
441–450 of 498 posts
Re: Ask HN: Did you encounter any leap year bugs today?
#442Re: Ask HN: Did you encounter any leap year bugs today?
#443class datetime.date(year, month, day)
which was attempting to generate "today, one year ago" by reusing the current month and day, but replacing the year with year-1.
Re: Ask HN: Did you encounter any leap year bugs today?
#444Earlier quoted context omitted.
Is March more logical? Feb 29 + 1 year = Feb 28.
You're begging the question. [1] "Feb 29 + 1 year" is verbatim restatement. --- You can say Feb 29 + 365 days = Feb 28. (And Feb 29 + 730 days = Feb 27.) --- EDIT: Note that in the context of birthdays, people use "calendar years," not "unit of time which is ~1 revolution around the sun." Birthdays aren't celebrated every X million seconds after the moment of birth. They are celebrated the same day each calendar year…
As a surprise for a friend of mine, I threw him a gigasecond party on the day he turned 1000 million seconds old. Yes he was surprised, and a good time was had by all.
Re: Ask HN: Did you encounter any leap year bugs today?
#445Earlier quoted context omitted.
365.2421 is more correct. Nasa explains: 365 +0.25 - 0.01 + 0.0025 - 0.00025 = 365.24225 https://pumas.nasa.gov/examples/how-many-days-are-year
>Omitting a leap year every 4000 years Wait, is this right? omitting every 100 and adding every 400 should be enough. EDIT: the 4000-year rule is just a proposal for now. So 365.2425 is correct.
Re: Ask HN: Did you encounter any leap year bugs today?
#446Earlier quoted context omitted.
This has been a factor in contract law for longer than computers have existed. "Subtract a year" or "Add a year" aren't really imprecise, it's just that there are two ways you can interpret it: 365 days, or 12 months. When adding, you get the same result: end of February, the 28th. Subtracting, you get one of March 1st for 365 days and February 28th for 12 months. Most jurisdictions use the 12 month standard, fwiw. I…
Which type of year? Sidereal or solar? Did you account for axial precession?
Re: Ask HN: Did you encounter any leap year bugs today?
#447Many years ago I visited Laos. We crossed the border at a rather remote and little-used border crossing. Laos issues 30-day tourist visas on arrival. We arrived on February first and I have a Laotian visa valid until February 30th, 2011. Not a leap year bug but a February bug. Ended up being inconsequential, but still makes for a fun story.
Re: Ask HN: Did you encounter any leap year bugs today?
#448Earlier quoted context omitted.
Is March more logical? Feb 29 + 1 year = Feb 28.
Feb 28 is definitely too early, you haven't lived a whole year yet since your birthday. So March 1 it is. It's not your birthday but you can celebrate having made it another year.
Your calendar year birthday would be March 1 since one full calendar year has elapsed.
But Feb 28 is the nearest day to one full solar year, assuming you were born before about 6pm local time on Feb 29.
Two-day long birthday it is! :)
Re: Ask HN: Did you encounter any leap year bugs today?
#449No, but some of our software writes data to rotating directories named after the date, and while doing some manual debugging on a test system, it started failing to create these directories the first time it rotated on Feb 29 UTC. Turns out it just happened to run out of disk space at that time, but I had myself convinced that it was a leap year bug for over an hour. :)
LOL, a good example of correlation does not equal causation.
Re: Ask HN: Did you encounter any leap year bugs today?
#450Earlier quoted context omitted.
LOL, a good example of correlation does not equal causation.
It's not. There was no correlation at hand here - this was just a coincidence