From: Rob Biedenharn Date: 2007-09-11T01:59:38+09:00 Subject: Re: Time question On Sep 10, 2007, at 12:25 PM, joep wrote: > I am writing a small piece that will include a date that needs to be > compared to the current time. > > EX. a = Time.now > b = db_cert_date + (72 months) > > if(a < b) > do something > elsif(a > b) > do something else > else > do this > end > > I am looking for the best way to add 72 months onto an old date and > then compare it with the current date. Does anyone have any ideas? > > Thanks in advance If db_cert_date was a Date, you could do: b = db_cert_date >> 72 -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com