Bug #10258
closedconversion WIN32OLE_VARIANT and Time
Description
今日、うささんに教えていただいたテストの失敗は、こういう事象と同様だと思われます。
require 'win32ole'
t0 = Time.new(2014,9,19)
t0 += 0.9999
v = WIN32OLE_VARIANT.new(t0)
t1 = v.value
p t0 # => 2014-09-19 00:00:00 +0900
p t1 # => 2014-09-19 00:00:01 +0900
p t0.to_f # => 1411052400.9999
p t1.to_f # => 1411052401.0
t0 = Time.new(2014,9,19, 0, 0, 59)
t0 += 0.9999
v = WIN32OLE_VARIANT.new(t0)
t1 = v.value
p t0 # => 2014-09-19 00:00:59 +0900
p t1 # => 2014-09-19 00:02:00 +0900
p t0.to_f # => 1411052459.9999
p t1.to_f # => 1411052520.0
Updated by suke (Masaki Suketa) about 10 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r47658.
ext/win32ole/win32ole.c (rbtime2vtdate, vtdate2rbtime): fix
the bug in conversion of milliseconds. [Bug #10258]
test/win32ole/test_win32ole_variant.rb
(test_conversion_dbl2date_with_msec,
test_conversion_time2date_with_msec): use assert_in_delta instead
of assert_equal to treat an acceptable error range.
Updated by suke (Masaki Suketa) about 10 years ago
- Backport deleted (
2.0.0: UNKNOWN, 2.1: UNKNOWN)
2.0.0と2.1へのBackportは不要です。
Updated by nagachika (Tomoyuki Chikanaga) about 10 years ago
- Backport set to 2.0.0: DONTNEED, 2.1: DONTNEED