|
@@ -288,10 +288,18 @@ public class CommonServiceImpl implements ICommonService {
|
|
|
//正则匹配成功
|
|
|
boolean validDateTimeFormat = isValidDateTimeFormat(v.toString());
|
|
|
if(validDateTimeFormat){
|
|
|
- LocalDateTime localDateTime = DateUtils.toLocalDateTime(v.toString(), "yyyy-MM-dd HH:mm:ss");
|
|
|
- DateTimeFormatter fmt = DateTimeFormatter.ofPattern(tableFormat);
|
|
|
- String dateStr = localDateTime.format(fmt);
|
|
|
- resultMap.put(k,dateStr);
|
|
|
+ if(v.toString().indexOf("T")>0){
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME; // 默认支持这种格式
|
|
|
+ LocalDateTime dateTime = LocalDateTime.parse(v.toString(), formatter);
|
|
|
+ DateTimeFormatter fmt = DateTimeFormatter.ofPattern(tableFormat);
|
|
|
+ String dateStr = dateTime.format(fmt);
|
|
|
+ resultMap.put(k,dateStr);
|
|
|
+ }else {
|
|
|
+ LocalDateTime localDateTime = DateUtils.toLocalDateTime(v.toString(), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ DateTimeFormatter fmt = DateTimeFormatter.ofPattern(tableFormat);
|
|
|
+ String dateStr = localDateTime.format(fmt);
|
|
|
+ resultMap.put(k,dateStr);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|