diff --git a/src/main/java/com/github/sd4324530/fastexcel/FastExcel.java b/src/main/java/com/github/sd4324530/fastexcel/FastExcel.java index 435a8e8..8a54332 100644 --- a/src/main/java/com/github/sd4324530/fastexcel/FastExcel.java +++ b/src/main/java/com/github/sd4324530/fastexcel/FastExcel.java @@ -291,9 +291,14 @@ public boolean createExcel(List list) { Cell cell = row.createCell(j); for (Map.Entry data : fieldMap.entrySet()) { if (data.getKey().equals(s[j])) { - Field field = data.getValue(); + Field field = data.getValue(); field.setAccessible(true); - cell.setCellValue(field.get(list.get(i)).toString()); + Object object = field.get(list.get(i)); + if (object instanceof Date) { + Date date = (Date)object; + object = format.format(date); + } + cell.setCellValue(object.toString()); break; } }