The difference is 6 hours. And it is because 1 year in seconds (as converted by the to_i
method) is defined as 365.25 days in Ruby on Rails core extensions:
>> 1.year.to_i / 60 / 60 / 24.0
=> 365.25
Those 0.25 days is the actual 6 hours difference. By doing this, RoR is trying to count in the leap years which (by basic approximation) occur once in 4 years. The same is also evident from the years
definition in Rails source code.
On the other hand 1.year.from_now
does a shift of a concrete calendar datetime instead. As if you turned pages on your wall calendar.