Project

General

Profile

Backport #7868

DateTime.now calculate negative timezone

Added by omid.mt (Omid Mehdizadeh) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:52303]

Description

I compiled 1.9.3-p374 on Solaris sparc. I found that the DateTime.now return time by wrong timezone in negative of what it should be. Time.now is OK.

irb(main):002:0> DateTime.now
DateTime.now
=> Sun, 17 Feb 2013 00:50:02 -0330

irb(main):006:0> Time.now
Time.now
=> 2013-02-17 00:28:07 +0330

irb(main):003:0> DateTime.now.zone
d.zone
=> "-03:30"

irb(main):004:0* DateTime.current
DateTime.current
=> Sat, 16 Feb 2013 21:20:28 +0000

This wrong timezone makes Time and DateTime comparison wrong.
As the implementation is in C now, couldn't figure out the logic.


Files

diff (407 Bytes) diff tadf (tadayoshi funaba), 02/18/2013 01:35 AM

Related issues

Has duplicate Ruby master - Bug #8226: incorrect timezone offset under Solaris 11 x64Closed04/06/2013Actions

Associated revisions

Revision 0d946b21
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

merge revision(s) 39475: [Backport #7868]

    * ext/date/date_core.c: [ruby-core:52303]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 116843c6
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 39475: [Backport #7868]

    * ext/date/date_core.c: [ruby-core:52303]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40227
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 39475: [Backport #7868]

* ext/date/date_core.c: [ruby-core:52303]

History

Updated by ko1 (Koichi Sasada) over 6 years ago

  • Category set to lib
  • Assignee set to tadf (tadayoshi funaba)
  • Target version set to 2.6

Funaba-san, could you check it?

Updated by omid.mt (Omid Mehdizadeh) over 6 years ago

I got this info in rails community, that may help on catching the issue faster.

pixeltrix: "Looks like it's a Ruby bug in date_core.c - the HAVE_VAR_ALTZONE section should invert the timezone or altzone value as that's the code path taken by Solaris (tm.tm_gmtoff is BSD/GNU C Library extension and altzone is set by the Solaris tzset function)."

Updated by tadf (tadayoshi funaba) over 6 years ago

does this fix it?

Updated by tadf (tadayoshi funaba) over 6 years ago

  • Status changed from Open to Feedback

Updated by omid.mt (Omid Mehdizadeh) over 6 years ago

Yes, It is OK now.

Thanks a lot.

#6

Updated by tadf (tadayoshi funaba) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Category deleted (lib)
  • Status changed from Feedback to Open
  • Assignee deleted (tadf (tadayoshi funaba))
  • Target version deleted (2.6)

r39475

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to nagachika (Tomoyuki Chikanaga)
#8

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Project changed from Backport193 to Backport200
#9

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39676.
Omid, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39475: [Backport #7868]

* ext/date/date_core.c: [ruby-core:52303]
#10

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Project changed from Backport200 to Backport193
  • Status changed from Closed to Assigned
  • Assignee changed from nagachika (Tomoyuki Chikanaga) to usa (Usaku NAKAMURA)
#11

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40227.
Omid, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39475: [Backport #7868]

* ext/date/date_core.c: [ruby-core:52303]

Also available in: Atom PDF