The month, day, and year methods on Fixnum are not accurate, which is why Time#advance was added. This patch creates a Duration class which makes these methods use Time#advance for accurate date and time processing:
>> Time.now
=> Tue Dec 12 23:59:38 PST 2006
>> 1.month.from_now
=> Fri Jan 12 23:59:46 PST 2007
The current results:
>> Time.now
=> Tue Dec 12 23:59:38 PST 2006
>> 1.month.from_now
=> Fri Jan 11 23:59:46 PST 2007
The same applies for years and days. This patch also addresses the disconnect between adding to a Time and adding to a Date. See #6803 for the a description of the problem.
I expect to go through at least a few updates of the patch, so feedback is appreciated! Tests are included.