Read Excel Date Column

Jul 28, 2009 at 4:59 PM

Hi i use this dll and i have a problem abaut dates.In excel i have column format date and its value = 31.07.2009

But when i get to dataset its value become 40055 so the date value is wrong.

How can i solve this problem

Aug 13, 2009 at 1:54 PM
Edited Aug 13, 2009 at 2:00 PM



I had the same behaviour, not really a pb.

This is the "Excel date" format.

It seems it is the number of days since a certain date (see below)


Just transform this number into a real date like this:

public DateTime TransformExcelDate(int ExcelDateNumber)
       DateTime dtref = new DateTime(1900, 1, 1).AddDays(-2);
       return dtref.AddDays(ExcelDateNumber);



Jan 15, 2010 at 11:56 AM


i solved this issue with DateTime.FromOADate( "double from excel" )