From: Kirk Haines Date: 2006-04-27T22:20:23+09:00 Subject: Re: Day number delta On Thursday 27 April 2006 6:30 am, Lindsay Boyd wrote: > How can I calculate the number of days between two Date objects?. This > is easy enough with Time objects using the epoch seconds method tv_sec. > Is there something similar for Dates? delta = a - b Just subtract one from the other. irb(main):001:0> require 'date' => true irb(main):002:0> a = Date.new(2006,4,28) => # irb(main):003:0> b = Date.new(2005,3,17) => # irb(main):004:0> c = a - b => Rational(407, 1) irb(main):005:0> c.to_i => 407 Kirk Haines