最近在对接javafx前端,界面用localdate比较方便,需要把date类型的数据查询出来转换
方法如下:
//localDate转Date
public Date changeLocalDate(LocalDate localDate) {
Instant instant = localDate.atTime(LocalTime.MIDNIGHT).atZone(ZoneId.systemDefault()).toInstant();
return Date.from(instant);
}