The date that is parsed by excel data reader is a few years off.
When parsing '9/8/2013' exceldatareader is giving me 40056
When it should actually be 41525
Using the attached xls file, dates are converted wrongly.
void Main()
{
var dt = DateTime.Parse("9/8/2013");
Double d = dt.ToOADate();
Console.WriteLine(d);
Console.WriteLine(DateTime.FromOADate(d));
// output from exceldata reader
Console.WriteLine(DateTime.FromOADate(40056));
}
Output
41525
9/8/2013 12:00:00 AM
8/31/2009 12:00:00 AM
When parsing '9/8/2013' exceldatareader is giving me 40056
When it should actually be 41525
Using the attached xls file, dates are converted wrongly.
void Main()
{
var dt = DateTime.Parse("9/8/2013");
Double d = dt.ToOADate();
Console.WriteLine(d);
Console.WriteLine(DateTime.FromOADate(d));
// output from exceldata reader
Console.WriteLine(DateTime.FromOADate(40056));
}
Output
41525
9/8/2013 12:00:00 AM
8/31/2009 12:00:00 AM