All,
In .NET, I'm using ClosedXML to read in an uploaded Excel file and converting the cells to a 2D array of strings. The end goal is to modify certain cells and display the modified cells to the user.
I'm currently having trouble handling cells that store DateTime values. Weirdly, when I read the cell's data type, it returns XLCellValues.Number (not XLCellValues.DateTime, which is what I would expect). I've found that Excel actually stores DateTimes as doubles with some metadata saying to convert it to a date, which might explain that issue.
I'm wondering if anyone knows of a way, using ClosedXML, to check if an Excel cell's value is a DateTime type? And, if so, how I can convert that value to a .NET DateTime?
Thanks!