Backport #7868
closedDateTime.now calculate negative timezone
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
Updated by ko1 (Koichi Sasada) almost 12 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) almost 12 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) almost 12 years ago
does this fix it?
Updated by tadf (tadayoshi funaba) almost 12 years ago
- Status changed from Open to Feedback
Updated by omid.mt (Omid Mehdizadeh) almost 12 years ago
Yes, It is OK now.
Thanks a lot.
Updated by tadf (tadayoshi funaba) almost 12 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) almost 12 years ago
- Status changed from Open to Assigned
- Assignee set to nagachika (Tomoyuki Chikanaga)
Updated by nagachika (Tomoyuki Chikanaga) almost 12 years ago
- Project changed from Backport193 to Backport200
Updated by nagachika (Tomoyuki Chikanaga) almost 12 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]
Updated by usa (Usaku NAKAMURA) over 11 years ago
- Project changed from Backport200 to Backport193
- Status changed from Closed to Assigned
- Assignee changed from nagachika (Tomoyuki Chikanaga) to usa (Usaku NAKAMURA)
Updated by usa (Usaku NAKAMURA) over 11 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]