Get Date from Excel Serial Date

This code shows how to Get Date from Excel Serial Date


A Small code which return Date from Excel Serial Date

private DateTime getDatefromSerialDate(int ExcelSerial)
if (ExcelSerial > 59) ExcelSerial -= 1;
return new DateTime(1899, 12, 31).AddDays(ExcelSerial);

To call the above Function try like this

DateTime dt=getDateFromSerialDate(470935);

Hope that will help some one


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: