Hello friends,
I'm having a problem while reading an .xls using ClosedXML
I'm trying to copy a worksheet into an html table. However, when I get down to the cells that have dates on them (see sample.xls), this is what I get:
Cell.GetFormattedString() = $-4417089]d-mmm-yy
Cell.Value = + 41708.0 {Double}
So, the value is taken as a double instead of a Date, and I haven't found any way to correct this. Any clues?
My version of ClosedXML is 0.59.0.0. However, I've downloaded the latest one, and I get the same results.
Thank you!
Comments: The DateTime.FromOADate works even if the value wasn't originally a Date in Excel. I'm having the same issue where numbers and Dates with certain formats come through as Numbers. At that point, there is no way to tell if it was supposed to be a date or not. The cell Style.DateFormat is populated even when it's just a number (and not a date). Anyone know how to properly figure out which fields are actually dates and which ones aren't?
I'm having a problem while reading an .xls using ClosedXML
I'm trying to copy a worksheet into an html table. However, when I get down to the cells that have dates on them (see sample.xls), this is what I get:
Cell.GetFormattedString() = $-4417089]d-mmm-yy
Cell.Value = + 41708.0 {Double}
So, the value is taken as a double instead of a Date, and I haven't found any way to correct this. Any clues?
My version of ClosedXML is 0.59.0.0. However, I've downloaded the latest one, and I get the same results.
Thank you!
Comments: The DateTime.FromOADate works even if the value wasn't originally a Date in Excel. I'm having the same issue where numbers and Dates with certain formats come through as Numbers. At that point, there is no way to tell if it was supposed to be a date or not. The cell Style.DateFormat is populated even when it's just a number (and not a date). Anyone know how to properly figure out which fields are actually dates and which ones aren't?