[ruby-core:32908] Re: WIN32OLE VT_DATE handling bug

From: Chuck Remes <cremes.devlist@...>
Date: 2010-10-26 15:26:33 UTC
List: ruby-core #32908
On Oct 26, 2010, at 10:10 AM, Chuck Remes wrote:

> I have found a problem with some date handling via the WIN32OLE API. Unfortunately I don't know how to provide a reproducible case because the COM program is proprietary, so I'm looking for guidance on how to file this bug.
> 
> Description
> The problem is exposed at the turnover from 23:59:00 to the start/midnight of the next day. First the code, then the output:
> 
>  # requested objects for a time range "2010/10/25 23:59" to "2010/10/26 00:01"
>  objects.each do |obj|
>    puts "#{obj.timestamp}, #{obj.timestamp.class}"
>  end
> 
> MRI 1.9.1-p430 (via RubyInstaller) produces:
> 
> 2010/10/25 23:59:00, String
> 2010/10/25 00:00:00, String
> 2010/10/26 00:01:00, String
> 
> 
> Under JRuby 1.5.1 using the very same code and the new jruby-win32ole support, it produces the correct output.
> 
> Mon Oct 25 23:59:00 -0500 2010, Time
> Tue Oct 26 00:00:00 -0500 2010, Time
> Wed Oct 26 00:01:00 -0500 2010, Time
> 
> 
> It looks to me like the MRI WIN32OLE code is mishandling the COM VT_DATE time conversion.
> 
> In the absence of a reproducible case, how should I write this bug report?

I apologize for the noise on this list. I installed MRI 1.9.2p0 and reran the test. This bug was apparently fixed in the 1.9.2 branch. It also returns Time objects now instead of Strings.

cr

In This Thread

Prev Next