For example: I am inserting date 2011-06-01 (format mm/dd/yyyy) and now I want to add 8 months to this date. I want the result to be 2012-02-01.
So when adding months, the year may also increase.
Rails provides for + n.days, n.months, etc.
my_date + 8.months
This is an ActiveRecord, not a Ruby thing, though. So make sure it's loading thru Rails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With