Hi All,
I am facing diffculty in reading date content from an excel file.
If the cell data i.e date is not formatted according to excel.
It is converted into double value.
Here is my code i have done
if (cell == null)
return value;
switch (cell.getCellType()) {
case Cell.CELL_TYPE_FORMULA:
value = "" + cell.getCellFormula();
break;
case Cell.CELL_TYPE_NUMERIC:
if (DateUtil.isCellDateFormatted(cell)) {
value = "" + cell.getDateCellValue();
}
else
{
value =""+cell.getNumericCellValue();
}
//value = cell.getStringCellValue();
break;
case Cell.CELL_TYPE_STRING:
value = cell.getStringCellValue();
break;
case Cell.CELL_TYPE_BOOLEAN:
value = "" + cell.getBooleanCellValue();
break;
default:
}
Is they any mechanism to get date value with out being converted to double
it can be in any format.
Thanks & Regards
anish
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/to-read-date-content-from-an-excel-file-tp3268820p3268820.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]