From: dblack@... Date: 2006-11-27T05:59:36+09:00 Subject: Re: Timestamp Hi -- On Sun, 26 Nov 2006, Srinivas Sa wrote: > My timestamps are HH:MM:SS,nnnn format.. I mentioned wrongly before... > > Srinivas Sa wrote: >> How do i add two time stamps >> >> Time stamps are in the form of HH:MM:DD:SS,nnnn >> >> Used Time.parse to convert to Time and tried add ts1 + ts2 but it failed >> saying no method. >> >> tried t1 + t1.to_i i am getting >> >> irb(main):013:0> p t1 + t2.to_i >> RangeError: time + 1164507831.000000 out of Time range >> from (irb):13:in `+' >> from (irb):13 >> >> can somebody help me out? You might find it interesting to look into some of the date/time extensions in ActiveSupport, the utility library that ships with Rails. You get things like: 20.hours # 72000 (# of seconds in 20 hours) David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org