You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MRI 1.9.3 apparently allows passing milliseconds into DateTime#civil, contrary to docs, which state that that argument should be the timezone offset. In cases where this feature is used (e.g. aws/aws-sdk-ruby) JRuby returns an error, see below:
jruby-1.7.13 :004 > DateTime.civil(2014, 01, 01, 12, 31, 14, 139)
ArgumentError: Invalid offset: 139
from /Users/bram.devries/.rvm/rubies/jruby-1.7.13/lib/ruby/1.9/date.rb:710:in `chronology'
from /Users/bram.devries/.rvm/rubies/jruby-1.7.13/lib/ruby/1.9/date.rb:1706:in `civil'
from (irb):4:in `evaluate'
from org/jruby/RubyKernel.java:1101:in `eval'
from org/jruby/RubyKernel.java:1501:in `loop'
from org/jruby/RubyKernel.java:1264:in `catch'
from org/jruby/RubyKernel.java:1264:in `catch'
Opposed to 1.9.3, which ignores the argument altogether.
for the record the 6-th argument on DateTime.civil is offset (and has always been - even in 1.9.3)
while MRI allows arbitrary offsets JRuby only accepts valid ones e.g. 1.to_r / 24 or '-07:00'
... I am into doing a rewrite on date.rb but will stil rely on JODA for internals so the 'incompat' stays
do not think this matters much as users (me included) usually are confused about that argument.
its probably for the best to fail early -> in MRI that 139 value certainly did not set any milliseconds
MRI 1.9.3 apparently allows passing milliseconds into DateTime#civil, contrary to docs, which state that that argument should be the timezone offset. In cases where this feature is used (e.g. aws/aws-sdk-ruby) JRuby returns an error, see below:
Opposed to 1.9.3, which ignores the argument altogether.
The text was updated successfully, but these errors were encountered: