String 转 LocalDate、LocalDateTime
LocalDate startDate = LocalDate.parse("2019-12-05", DateTimeFormatter.ofPattern("yyyy-MM-dd"));
LocalDateTime startDateTime = LocalDateTime.parse("2019-12-05 15:30:11", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
LocalDate、LocalDateTime 转 Date
Date date = Date.from(LocalDate.now().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
Date date = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());
LocalDate、LocalDateTime 转 String
String currentTime = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String currentTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));