1.8的LocalDate和Date之间的相互转换需要借助Date中新增的from()和toInstant()
LocalDate 转Date
1.需要先将LocalDate转为LocalDateTime
LocalDate.atStartOfDay()
2. 获取 Instance,需要指定时区,这里使用系统默认
LocalDateTime.atZone(ZoneId.systemDefault()).toInstant()
3.转化
Date.from()
连起来就是
Date.from(LocalDate.now().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant())
Date转LocalDate
new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate()