-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
I will explain the problem briefly:
[25] pry(main)> `ruby -v`
=> "ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]\n"
[26] pry(main)> Time.new.getlocal(0)
=> 2015-01-07 20:55:12 +0000
[27] pry(main)> Time.new.getlocal(1)
=> 2015-01-07 20:55:15 +0000
[28] pry(main)> Time.new.getlocal(3000)
=> 2015-01-07 21:45:17 +0050
[29] pry(main)> Time.new.getlocal(-3000)
=> 2015-01-07 20:05:19 -0050
[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)>
According to the documentation (MRI), Time#getlocal can accept an optional utc_offset parameter, which is a Fixnum (http://www.ruby-doc.org/core-2.1.5/Time.html#method-i-utc_offset).
Reactions are currently unavailable