[James Edward Gray II <james / grayproductions.net>, 2004-08-27 16.07 CEST] > On Aug 27, 2004, at 8:43 AM, Carlos wrote: > > >Anyway, don't use Time: you will have problems when you add 86400 > >seconds to > >advance a day if it's near midnight and on the day when the summer time > >changes. > > You bring up a good point, but is this true... > > Time keeps track of it's value in seconds since the Epoch right? Then > just conveniently answers questions about what day that number of > second would fall on, well if I understand it correctly anyway. > > My program just pushes the number of seconds forward. Then Time should > answer my questions based on the new count, taking into account things > like Daylight Savings Time, Leap Year, etc., right? It does, but saving time breaks the continuity. If x seconds from the epoch means 15:00:00, x+1 seconds could mean 16:00:01. Look: irb(main):001:0> t=Time.mktime 2004,"mar",27,23,30,0 => Sat Mar 27 23:30:00 CET 2004 irb(main):002:0> t+86400 => Mon Mar 29 00:30:00 CEST 2004