
This little snippet here will allow you to convert excel encoded date to standard Windows DateTime.
public static DateTime ExcelDateConverter(int excelDateSerial)
{
if (excelDateSerial <>
{
excelDateSerial++;
}
return new DateTime((excelDateSerial + 693593) * (10000000L * 24 * 3600));
}
Back to Home

Why dont u use DateTime.FromOADate(double d) (standard 1.1.4 framework)??
ReplyDeleteIt works perfectly when u have a datetime column in excel and then convert it to text. It will result in a int number. This method convert it to a datetime again.
Dear Anonymous,
ReplyDeletecan you explain your method please...
@fatih he's right..
ReplyDeleteyou can do something like this:
Dim d As DateTime = DateTime.FromOADate(numbertoconvert)
and it works perfectly!