From: Paul Lutus Date: 2006-11-26T18:35:08+09:00 Subject: Re: Timestamp 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. Saying what? Please paste the code and the exact wording of the error message into your newsreader. > 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 Of course adding two times near the present would exceed the total range of possible times, between December 31, 1969 (time approx. = 0) and January 18, 2038 (time approx. = (2^31)-1). That is the entire, total range for time variables, and if you try to add two times near the present, November 11, 2006 (time approx. = 1164533263), you will overflow the acceptable range. But this is an obvious error. Why not tell us what you are trying to accomplish? > > can somebody help me out? Sure, no problem, I will be happy to help you out. But first, you need to tell me that you want. Computer programming can be described as telling a computer what you want, in excruciatingly specific terms. Be just as specific in your reply. 1. I want this ____________________ 2. But instead, I got this ______________________ 3. Here is how (1) and (2) differ from each other _________________ You have only described a problem on the way to a goal, but you didn't mention what the goal was. -- Paul Lutus http://www.arachnoid.com