From: Greg Go Date: 2008-01-10T13:24:39+09:00 Subject: Re: DateTime new_offset unexpected results Dirk Traulsen wrote: > Hi Greg! > > Am 8 Jan 2008 um 6:05 hat Greg Go geschrieben: > >> @jd.to_s #=> 2008-03-09T13:24:59+00:00 >> @ld.to_s #=> 2008-03-09T06:24:59-06:00 >> ^^^^^^ >> !!!!!! >> >> It's my understanding that 13:24:59 offset by -6 hours should result >> in >> 7:24:59, not 6:24:59. The @ld instance seems to be confused? > > It looks like the reason could be the error that I found: > > http://rubyforge.org/tracker/?func=detail&atid=1698&aid=14540& > group_id=426 > > It is a rounding error inside Numeric#divmod, which I found while > inquiring a similar error in date. This bug was confirmed for 1.8.6 and > is fixed (for future versions). If you compile Ruby yourself, this > patch could fix your problem too. > > Hope this helps > Dirk Dirk: Building ruby myself is a little outside my comfort zone. In my opinion, one of the major strengths of interpreted languages is that I can avoid the compilation process, which I find to be tedious and difficult. Some questions: Is the bug fix included in 1.9.0? If not, is there any way at all to work around the problem? I've tried a number of things, but nothing seems to help. Thanks! Greg -- Posted via http://www.ruby-forum.com/.