Building time interval

irb(main):001:0> t1 = Time.now
=> Fri Mar 19 10:20:10 AUS Eastern Daylight Time 2004
irb(main):002:0> t2 = Time.now + 1000000
=> Tue Mar 30 23:07:00 AUS Eastern Standard Time 2004
irb(main):003:0> t3 = Time.at(t2 - t1)
=> Tue Jan 13 00:46:50 AUS Eastern Daylight Time 1970

···

-----Original Message-----
From: gabriele renzi [mailto:surrender_it@rc1.vip.ukl.yahoo.com]
Sent: Friday, 19 March 2004 2:05 AM
To: ruby-talk ML
Subject: building time interval

hi gurus and nubys,

I wonder: is there a simple way to build a relative time object from
seconds?

I mean something like:

t= Time.gm(5,‘jan’,1,1,1,1)
t2= Time.gm(5,‘feb’,1,1,1,1)

interval= t2 - t1
p Time.from_interval interval
"4 weeks 3 days 0 hours 0 minutes 0 seconds "

(probably not, but the date/time world is quite onscure to me, and in
ruby it’s quite large)