How to determine whether a spread-sheet cell contains a date, or a real number?

Posted by Everyone on Stack Overflow See other posts from Stack Overflow or by Everyone
Published on 2010-04-16T20:12:13Z Indexed on 2010/04/16 20:23 UTC
Read the original article Hit count: 238

Filed under:
|
|
|

When a cell in a spreadsheet contains a simple date (mm/dd/yyyy) the poi API flags the cell-type as 'numeric'. This is probably because spreadsheets ( IMO ) historically recognize only strings and real numbers.

It is possible to hard-code the cell-index, and use it conditionally to call 'getDateCellValue'. But this feels like a hack.

What other ways are there in the poi API to determine whether the content in a cell is a Date rather than a real number?

© Stack Overflow or respective owner

Related posts about java

Related posts about poi-hssf