From: Todd Benson Date: 2008-01-10T21:42:36+09:00 Subject: Re: DateTime new_offset unexpected results On Jan 9, 2008 10:11 PM, Greg Go wrote: > Todd Benson wrote: > > On Jan 7, 2008 3:05 PM, Greg Go wrote: > >> Thanks for your reply. > >> It's only the rise object for this invocation of the day class that > >> fails, and only for DST times. > > > > And only with Rational(-6, 24) during the rise event? > > > >> @ld = @jd.new_offset(offset) > > Try (#'s mark the additional/changed lines)... > > > > offset = Rational(-7, 24) > > puts "dstStart before IF: " << @@dstStart ### > > puts "dstEnd before IF: " << @@dstEnd ### > > if (@jd > @@dstStart) && (@jd < @@dstEnd) > > puts "dstStart after IF: " << @@dstStart ### > > puts "dstEnd after IF: " << @@dstEnd ### > > offset = Rational(-6, 24) > > end > > @ld = @jd.new_offset(offset) > > > > puts @jd ### > > puts @ld ### > > > > and see what you get for the rise event (just out of curiosity). > > > > Todd > > Todd: > > Although I'm not sure what this proves, I did this, and the two class > variables (@@dstStart, @@dstEnd) didn't change. I'm unclear as to where > you're going with this -- am I missing something with the way that ruby > handles class variables? Simple. Just wanted to see if your dstStart and dstEnd vars were correct, and if, in fact, you were actually entering the if condition. It's probably the bug that was mentioned, but I can't reproduce your error. Todd