ExcelUtil icon indicating copy to clipboard operation
ExcelUtil copied to clipboard

转换日期问题

Open LUOYD opened this issue 8 years ago • 3 comments

我根据方法要求吧传入的日期按照日期格式输入好(如yyyy/MM/dd) 但是输出的内容并不是Date类型(内容为:43039.3816203704)

LUOYD avatar Nov 09 '17 03:11 LUOYD

经过测试 发现 public static <T> Collection<T> importExcel(Class<T> clazz, InputStream inputStream, String pattern, ExcelLogs logs, Integer... arrayCount) 方法中pattern参数无论传入什么日期格式,只能解读yyyy-MM-dd格式

LUOYD avatar Nov 09 '17 04:11 LUOYD

是不是吧最新的代码打一个 maven 包就会好一点

LUOYD avatar Nov 09 '17 04:11 LUOYD

需要你excel中单元格的类型是"字符串",并且Bean中字段类型是 java.Date 才会使用 pattern 解析

SargerasWang avatar Nov 09 '17 05:11 SargerasWang