summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-22 09:20:38 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-22 09:20:38 +0000
commit59fadede2bbfa78362e81680e416fdce54e27baf (patch)
tree3168e7aa098a5d302fdad075687214b7fa75303f /test
parentcb66eaab150fe8687c3b7b5bdd082c9016223b87 (diff)
merge revision(s) 54169: [Backport #12189]
* ext/date/date_core.c (datetime_to_time): preserve timezone info [Bug #12189] [Fix GH-1295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/date/test_date_conv.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/date/test_date_conv.rb b/test/date/test_date_conv.rb
index daf0374294..e7f412f2ca 100644
--- a/test/date/test_date_conv.rb
+++ b/test/date/test_date_conv.rb
@@ -31,12 +31,10 @@ class TestDateConv < Test::Unit::TestCase
end
def test_to_time__from_datetime
- d = DateTime.new(2004, 9, 19, 1, 2, 3, 9.to_r/24) + 456789.to_r/86400000000
+ d = DateTime.new(2004, 9, 19, 1, 2, 3, 8.to_r/24) + 456789.to_r/86400000000
t = d.to_time
- if t.utc_offset == 9*60*60
- assert_equal([2004, 9, 19, 1, 2, 3, 456789],
- [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec])
- end
+ assert_equal([2004, 9, 19, 1, 2, 3, 456789, 8*60*60],
+ [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec, t.utc_offset])
d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789.to_r/86400000000
t = d.to_time.utc