From: ara.t.howard@... Date: 2006-09-06T06:43:38+09:00 Subject: [ANN] timeunits-0.0.0 we've all written bits of it before, here it is for that don't want to: NAME timeunits.rb URIS http://rubyforge.org/projects/codeforpeople/ http://codeforpeople.org/lib/ruby/ SYNOPSIS adds methods to Numeric and Time classes to support time units and time difference units. EXAMPLE harp:~ > cat a.rb require "timeunits" require "yaml" now = Time::now a = now y "a" => a b = now + 2.hours + 2.minutes y "b" => b d = b - a %w( seconds minutes hours days ).each do |unit| y "d.#{ unit }" => d.send(unit) end harp:~ > ruby a.rb a: 2006-09-05 15:33:23.697319 -06:00 b: 2006-09-05 17:35:23.697319 -06:00 d.seconds: 7320.0 d.minutes: 122.0 d.hours: 2.03333333333333 d.days: 0.0847222222222222 DOCS see lib/* enjoy. -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