Commit d029ffde7ba499d2c5bdb4ca6f73aaaf4d9713f3
1 parent
e5b28cab
Exists in
master
优化读取日期
Showing
2 changed files
with
3 additions
and
3 deletions
 
Show diff stats
build.gradle
src/main/java/com/taover/util/UtilExcel.java
| ... | ... | @@ -451,7 +451,7 @@ public class UtilExcel { | 
| 451 | 451 | short format = cell.getCellStyle().getDataFormat(); | 
| 452 | 452 | if (cell.getCellStyle().getDataFormat()==28 || cell.getCellStyle().getDataFormat()==22||cell.getCellStyle().getDataFormat()==31 | 
| 453 | 453 | || cell.getCellStyle().getDataFormat() == 58 || cell.getCellStyle().getDataFormat()==14 | 
| 454 | - || cell.getCellStyle().getDataFormat()==57 || cell.getCellStyle().getDataFormat()==32 || cell.getCellStyle().getDataFormat()==20) { | |
| 454 | + || cell.getCellStyle().getDataFormat()==57 || cell.getCellStyle().getDataFormat()==32 || cell.getCellStyle().getDataFormat()==20 || cell.getCellStyle().getDataFormat()==176) { | |
| 455 | 455 | |
| 456 | 456 | // 如果是date类型则 ,获取该cell的date值 | 
| 457 | 457 | //return new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getJavaDate(cell.getNumericCellValue())); | 
| ... | ... | @@ -515,7 +515,7 @@ public class UtilExcel { | 
| 515 | 515 | System.out.println(df.format(3.3300)); | 
| 516 | 516 | |
| 517 | 517 | |
| 518 | - String filepath = "C:\\Users\\EDZ\\Desktop\\testjson1.xlsx"; | |
| 518 | + String filepath = "C:\\Users\\EDZ\\Desktop\\ttt.xlsx"; | |
| 519 | 519 | List<List<Object>> data = null; | 
| 520 | 520 | |
| 521 | 521 | try { | ... | ... |