In relation to your follow-up question about how to determine if the cell contains a date value or not the answer is that there isn't any easy way.
The cell, <c>
, element has a type attribute t
but it isn't used for this Excel serial date type. As such the only thing that distinguishes a cell that contains a date encoded as 40817 and a cell with the value 40817 is the format that is applied to the number (that is referenced via the s
cell attibute).
In order to determine that format you would have to look up the numFmtId
attribute of the referenced style xf
in the associated styles.xml
and try to determine if that format is a date format. And in order to do that you would have to apply some heuristics.
All in all this is a huge pain when you wish to differentiate dates from other numeric data and to me this is an oversight in the SpreadsheetML format.
P.S. The OOXML standard does define a d
date value for the t
type attribute but that is only used for ISO 8601 dates which aren't actually produced by Excel. (Update: this date format is now used in Excel 2013 in strict mode).