From: Daniel Lucraft Date: 2007-07-04T00:35:46+09:00 Subject: Re: How do I add x months to a date Ben Edwards wrote: > On 03/07/07, Glen Holcomb wrote: >> > manipulate it there, if and when I needed an actual date object with that >> > value I would create a date object and give that out. > > This all seems like a lot of messing around for what should be a > standard operation. This type of thing must exist in one of the > standard libraries. > > Ben Actually, you are totally right. The '>>' operator does what is required: irb> my_date = Date.new( 2007, 1, 1 ) => # irb> my_date.to_s => "2007-01-01" irb> (my_date >> 4).to_s => "2007-05-01" best, Dan -- Posted via http://www.ruby-forum.com/.