There was a bug in ExcelBinaryReader: when read file as DataSet DateTime cells often read incorrectly.
the excel file format
and fixed DateTime
format detection for
NUMBER_OLD, RK, MUL_RK and
FORMULA* cell types, which
contain the date.
I would be
if you could review and test
this is my
first participation in
Apr 25, 2011 at 10:44 PM
Edited Apr 26, 2011 at 7:30 PM
Before anythink else: thanks for your time!
I'm JP Negri, the negrijp from the developers list.
I downloaded and applied your patch to my local copy to revise. It all worked fine, excepet a unit test on
ExcelBinaryReaderTest.Test_num_double_date_bool_string() line 353. The retrieved value misses the time part, as expected in the test.
Is realy the intention retrieve only what is displayed on screen (in my case "2009-05-07") or the underlying value (2009-06-07 11:01:02)? If the answer is the first, the we must change the unitary test to reflect that.
It´s my personal view and usage that the library should not try to convert numbers to dates, as Excel itself does not have an internal representation for dates, and trying this based on formating is trick. But, as this is an Open Source project, we
must listem to the peoples choice, and just deliver.
What is your opinion? Anyone want to talk about this?
I will hold on a few days before changing the unity test and uploading a new revision to the trunk.
My best regards,
I also uploaded a patch for this and other type conversion issues (preserve data types patch). My feeling is that the internal representation of dates is irrelevant. Functionally, excel does have the concept of a date, boolean, etc. If
you look at alternatives, such as the microsoft ado driver as well as other commercial products, these datatypes are not lost. I imagine that for most functional purposes, maintaining datatypes would be desirable. With regard to the AsDataSet method,
it can specify to convert OA dates, yet it doesn't always do so. Perhaps this could be configurable for all datatypes??
Hello, JP Negri!
we have to convert OA
date from it binary representation (number),
cell format indicated
that this is
date. But if anyone need - it can be customisable to turn off this convertion.
About the fact
we rely on the
to determine that
stores the date
it corresponds with
No need to changing unit test, because it have to read
entire date with time part as it written to cell F1 ([0,5]) in test file (I see that as "07.05.2009 11:01:02"). On my computer, test work correctly, perhaps it can be caused by
Culture settings. I think it would be better if I retest it with your System Culture and maybe fix, before you uploading to trunk.
you use in your system?
Your sincerely, Andrey.