From: A LeDonne Date: 2006-01-30T13:28:40+09:00 Subject: Re: relative dates On 1/29/06, Cameron McBride wrote: > > how can I do this? "last_week = 7.days.ago" > > or subtract in seconds: > last_week = today - 7*24*60*60 > > Cameron > This is probably going to be easier with Date than with Time... irb(main):001:0> require 'date' => true irb(main):002:0> now = Date.today; now.strftime() => "2006-01-29" irb(main):003:0> last_week = now - 7; last_week.strftime() => "2006-01-22" If you are concerned about times, you can use DateTime in place of Date above. -A