From: ara.t.howard@... Date: 2006-09-06T09:53:16+09:00 Subject: Re: [ANN] timeunits-0.0.0 On Wed, 6 Sep 2006, Logan Capaldo wrote: > I'm not exactly sure what delta.days means in this case, but rails does the > following with your example: it's the difference (delta) in days. > > % script/console > Loading development environment. >>> a = Time.now > => Tue Sep 05 19:50:11 -0400 2006 >>> b = a + 42.seconds > => Tue Sep 05 19:50:53 -0400 2006 >>> delta = b - a > => 42.0 >>> p delta.days > 3628800.0 > => nil right. that is totally wrong. the difference is only 42 seconds, therefor it should be a fractional day. eg. harp:~ > cat a.rb require 'yaml' require 'rubygems' require 'timeunits' a = Time.now.utc b = a + 42.seconds delta = b - a y 'delta.decades' => delta.decades y 'delta.years' => delta.years y 'delta.months' => delta.months y 'delta.days' => delta.days y 'delta.minutes' => delta.minutes y 'delta.seconds' => delta.seconds harp:~ > ruby a.rb delta.decades: 1.44675925925926e-07 delta.years: 1.44675925925926e-06 delta.months: 1.73611111111111e-05 delta.days: 0.000486111111111111 delta.minutes: 0.7 delta.seconds: 42.0 the src is extremely short - read it for details. hopefully though, this example show the difference. -a -- what science finds to be nonexistent, we must accept as nonexistent; but what science merely does not find is a completely different matter... it is quite clear that there are many, many mysterious things. - h.h. the 14th dalai lama