jdk8中奖Date转换为String格式的方法
public static String getLocalDateStr(Date date,String formatter) {
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(formatter);
Instant instant = date.toInstant();
ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zoneId);
String dateStr = dateTimeFormatter.format(localDateTime);
return dateStr;
}