Date date = new Date();
Time time = new Time(date.getTime());
LocalDate localDate = date.toInstant.atZone(ZoneId.systemDefault()).toLocalDate();
LocalTime localtime = time.toLocalTime();
LocalDateTime localDateTime = LocalDateTime.of(localDate, localtime);
Date date1 = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
System.out.println(date1);
相关链接:
Java 8 – Working with LocalDate, LocalTime, LocalDateTime – tutorial with examples
LocalDate与Date转化
https://www.cnblogs.com/liusk/p/9882217.html
Convert between LocalTime to java.sql.Time
https://howtodoinjava.com/java/date-time/localtime-to-sql-time/