我需要检测单元格格式是日期、时间还是日期时间。
我的代码是:
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
if (DateUtil.isCellDateFormatted(cell)) {
if ( ??? )
return "Time";
else if ( ??? )
return "Date";
else
return "Datetime";
}
}
Run Code Online (Sandbox Code Playgroud)
我使用 ApachePOI 3.6