Skip to content

Instantly share code, notes, and snippets.

@Toady00
Created July 14, 2013 05:08
Show Gist options
  • Save Toady00/5993282 to your computer and use it in GitHub Desktop.
Save Toady00/5993282 to your computer and use it in GitHub Desktop.
JRuby discrepancy with Time.
# irb session using: jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_13-b20 [darwin-x86_64]
Time.new(2013, 1, 1, 12, 0, 0, "-05:00")
#=> 2013-01-01 12:00:00 +0500
Time.new(2013, 1, 1, 12, 0, 0, "+05:00")
#=> 2013-01-01 12:00:00 -0500
# irb session using: ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-darwin12.3.0]
Time.new(2013, 1, 1, 12, 0, 0, "-05:00")
#=> 2013-01-01 12:00:00 -0500
Time.new(2013, 1, 1, 12, 0, 0, "+05:00")
#=> 2013-01-01 12:00:00 +0500
@Toady00
Copy link
Author

Toady00 commented Jul 14, 2013

It isn't obvious at first glance, but the signs of the offsets are reversed in JRuby. I figured this should be an easy fix, but I'm not familiar with the JRuby code base. If someone could point me in the right direction, I'll try to create a fix and PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment