Currently i have my code as
bean.setREPO_DATE(row.getCell(16).getDateCellValue());
it works fine if cell is formatted as date in excel.
However it also converts some integer or long like 1234 or 5699 to date. I know the reason behind this too.
However i want to apply a check before executing above line. Something like this
if(row.getCell(16).isOfDateFormat){
bean.setREPO_DATE(row.getCell(16).getDateCellValue());
}
Please Guide me..
Thanks in Advance !
Try this,
use import org.apache.poi.ss.usermodel.DateUtil;
if(DateUtil.isCellDateFormatted(cell))
{
cell.getDateCellValue();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With