2

I'm reading an Excel spreadsheet (xlsx) using OpenXmlDocument, I have some Date cells formated as DD/MM/YYYY, But when try to read it all i have back is a float like this 42457.670138888891 I was looking into cell.DataType but it is always null.

I have two questions refered to this:

1- How do I know that current cell is Date / DateTime formatted or How to know is Date type ?

2- How to convert 42457.670138888891 to c# DateTime?

Juan Pablo Gomez
  • 5,203
  • 11
  • 55
  • 101
  • This may help you http://stackoverflow.com/questions/13176832/reading-a-date-from-xlsx-using-open-xml-sdk – Azar Shaikh May 22 '17 at 03:50
  • This may also help - http://stackoverflow.com/questions/42390713/openxml-sdk2-5-excel-how-to-determine-if-a-cell-contains-a-numeric-value/42492723#42492723 – petelids May 22 '17 at 11:47
  • Neither of the comments answer the question, though. Azar's just says how to convert the numeric value to a date and petelids' just says that you have to rely on the style to determine if the number is a date or not. How do you know if a value is a date or not if it's type is just Number? – Sean Feb 15 '19 at 14:21

0 Answers0