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
[4] pry(main)> `ruby -v`
=> "jruby 1.7.18 (2.0.0p598) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.7.0_71-b14 [darwin-x86_64]\n"
[5] pry(main)> Time.new.getlocal(0)
ArgumentError: "+HH:MM" or "-HH:MM" expected for utc_offset
from org/jruby/RubyTime.java:443:in `getlocal'
[6] pry(main)> Time.new.getlocal(1)
ArgumentError: "+HH:MM" or "-HH:MM" expected for utc_offset
from org/jruby/RubyTime.java:443:in `getlocal'
[7] pry(main)> Time.new.getlocal(3000)
ArgumentError: "+HH:MM" or "-HH:MM" expected for utc_offset
from org/jruby/RubyTime.java:443:in `getlocal'
[8] pry(main)> Time.new.getlocal(-3000)
ArgumentError: "+HH:MM" or "-HH:MM" expected for utc_offset
from org/jruby/RubyTime.java:443:in `getlocal'
[9] pry(main)>
Fixed in commit dbf58e6. This yielded a couple of other smaller fixes at the same time on both 1.7 and master. I did not try original snippet so the original reporter can reopen if somehow this is not correct.
I will explain the problem briefly:
According to the documentation (MRI),
Time#getlocal
can accept an optionalutc_offset
parameter, which is a Fixnum (http://www.ruby-doc.org/core-2.1.5/Time.html#method-i-utc_offset).The text was updated successfully, but these errors were encountered: