New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time.new: the UTC offset is always negative #591

Closed
janaz opened this Issue Mar 18, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@janaz

janaz commented Mar 18, 2013

Time.now in JRuby 1.7.3 is not working as expected.
When the UTC offset passed to the Time.new is a positive value (i.e. "+12:34"), it is converted to a negative offset("-12:34").

Here is an example where I compared outputs from MRI 1.9.2 and JRuby 1.7.3

Ruby 1.9.2:

1.9.2p320 :009 > RUBY_VERSION
=> "1.9.2"
1.9.2p320 :011 > Time.new(2012, 10, 19, nil, nil, nil, "+03:00").utc_offset
=> 10800

Jruby 1.7.3

irb(main):036:0> JRUBY_VERSION
=> "1.7.3"
irb(main):038:0> Time.new(2012, 10, 19, nil, nil, nil, "+03:00").utc_offset
=> -10800

@ghost ghost assigned BanzaiMan Mar 19, 2013

@BanzaiMan BanzaiMan closed this in 1c2e4ce Mar 19, 2013

@BanzaiMan

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Mar 19, 2013

Member

Hmm. Not quite. The sign is inverted wrong.

Member

BanzaiMan commented Mar 19, 2013

Hmm. Not quite. The sign is inverted wrong.

@BanzaiMan BanzaiMan reopened this Mar 19, 2013

@BanzaiMan

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Mar 24, 2013

Member

Specs are here: rubyspec/rubysepc@f00b0b7

Member

BanzaiMan commented Mar 24, 2013

Specs are here: rubyspec/rubysepc@f00b0b7

@BanzaiMan BanzaiMan closed this in 43d635d Mar 24, 2013

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