I need to retrieve an excel column of date.
My first column 'A' values are formatted like this6/20/2016 10:44. I have no problem of retrieving column 'A' with this format using
using DocumentFormat.OpenXml;
double d = double.Parse(theCell.InnerText);
DateTime conv = DateTime.FromOADate(d).Date;
My second column 'B' is formatted as 6/20/2016. With no time, just date.
but my problem is when i tried this code below:
using DocumentFormat.OpenXml;
double d = double.Parse(theCell.InnerText);
DateTime conv = DateTime.FromOADate(d).Date;
theCell.InnerText value is 1455
I am having a different value. the value changes into 12/25/1903 12:00:00 AM
How can I retrieve excel values with this kind of date format 6/30/2016 ?
theCell.InnerTextandd? 12/3/1909 is 3,265. Somehow the text in that cell is rendering that value. This sounds oversimplified, but it looks like you're not reading the cell you think you are reading. I don't know OpenXml, but if you were using COM I'd have some suggestions to debug.