The difference is 6 hours . And this is because 1 year in seconds (converted by the to_i method) is defined as 365.25 days in Ruby on Rails kernel extensions:
>> 1.year.to_i / 60 / 60 / 24.0 => 365.25
Those 0.25 days are the actual difference of 6 hours. Thus, RoR tries to count in leap years, which (through the base approximation ) occur once every 4 years. The same can be seen from the definition of years in the Rails source code .
1.year.from_now , 1.year.from_now other hand, 1.year.from_now particular calendar day instead. Itβs as if you have turned pages into your wall calendar.
Borama
source share