Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
DinaCoder99
on March 1, 2024
|
parent
|
context
|
favorite
| on:
Ask HN: Did you encounter any leap year bugs today...
> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 28))
Curiously, this is also not quite a year, even though the days and months are the same.
mr_toad
on March 1, 2024
[–]
It’s probably comparing the number of days between the dates with the number of days in a year, which would usually work.
EnigmaticLion
on March 1, 2024
|
parent
[–]
Source is a lot more complicated than i thought it will be:
https://github.com/rails/rails/blob/v6.1.7.7/actionview/lib/...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Curiously, this is also not quite a year, even though the days and months are the same.