I am using the POI version 3.5. I want to identify a Cell is a date 
formatted cell. I was looking at the interface 
org.apache.poi.ss.usermodel.Cell 
which is not having a field to identify a date formatted cell. 

When I tried the below code 

CellReference cellReference = new CellReference("A5");
Row row = sheet.getRow(cellReference.getRow());
Cell cell = row.getCell(cellReference.getCol());
int cellFormat = cell.getCellType();

the value of the cellFormat is 0 for both numeric and date fields. 

But I can alternativley identify a date cell by using below code 

if(cellFormat == CELL.CELL_TYPE_NUMERIC) {
    if(DateUtil.isCellDateFormatted(cell)) {
        //Date cell 
    } else {
       //Numeric cell
    }
}

but is there a way to check the date cell straight away with out calling 
the DateUtil class.


Regards,

Vijayakumar Gowdaman


---

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional 
EU corporate and regulatory disclosures.

Reply via email to