Backport #7868
closed
DateTime.now calculate negative timezone
Added by omid.mt (Omid Mehdizadeh) almost 12 years ago.
Updated over 11 years ago.
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
|
|
- Category set to lib
- Assignee set to tadf (tadayoshi funaba)
- Target version set to 2.6
Funaba-san, could you check it?
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)."
- Status changed from Open to Feedback
Yes, It is OK now.
Thanks a lot.
- 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)
- Status changed from Open to Assigned
- Assignee set to nagachika (Tomoyuki Chikanaga)
- Project changed from Backport193 to Backport200
- 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]
- Project changed from Backport200 to Backport193
- Status changed from Closed to Assigned
- Assignee changed from nagachika (Tomoyuki Chikanaga) to usa (Usaku NAKAMURA)
- 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
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0