HSSF POI : How to know if data in cell is of Type Date?

后端 未结 1 1979
悲&欢浪女
悲&欢浪女 2021-01-12 03:20

Currently i have my code as

bean.setREPO_DATE(row.getCell(16).getDateCellValue());

it works fine if cell is formatted as date in excel.

相关标签:
1条回答
  • 2021-01-12 04:15

    Try this,

    use import org.apache.poi.ss.usermodel.DateUtil;

    if(DateUtil.isCellDateFormatted(cell))
       {
           cell.getDateCellValue();
       }
    
    0 讨论(0)
提交回复
热议问题