I get a weird conversion error when converting from local time zone to utc for far future dates:
Time.zone = 'Copenhagen'
JRuby 1.7.4: => "1816-03-30 04:55:08"
MRI 2.0.0p195 => "9999-12-31 22:59:00"
Weird one. Looking into it briefly.
On my system on JRuby master:
system ~/projects/jruby $ jirb
irb(main):001:0> require 'active_support/core_ext'
irb(main):002:0> Time.zone = 'Copenhagen'
irb(main):003:0> Time.zone.parse('9999-12-31 23:59').to_s(:db)
=> "9999-12-31 22:59:00"
Can you confirm?
/cc @eregon since he's working on Time/Date stuff right now for GSoC.
Works fine with jruby 1.6.7 (ruby-1.9.2-p312) at me, weird.
jruby 1.6.7 (ruby-1.9.2-p312)
Looks like a regression in 1.7.x, but it's fixed on master already.
We'll call it fixed in 1.7.5 then.
Mmh I look commits between now and jruby 1.7.4 and some like ffc93bf which could have fixed it.
The nanos-to-millis field is really a big source of bugs, I met a couple and created (and hopefully fixed) a couple others while working on time/date.
I wish to make DateTime millis always be 000 and nsec be nanos (everything under the second). It would avoid many useless/unreadable modulos and divisions. Could we change that or is it a big compat problem?
Confirmed, ffc93bf fixed it, thanks @tychobrailleur!
@eregon Yes, I think that was as part of the #652 fix. :-)