LocalDate转换成Date

 

 

LocalDate nowLocalDate = LocalDate.now();
Date date = Date.from(nowLocalDate.atStartOfDay(ZoneOffset.ofHours(8)).toInstant());
       

 

 

 

Date 转 LocalDate

Date startDate=new Date();
LocalDate localDate =startDate.toInstant()
                    .atZone(ZoneId.systemDefault())
                    .toLocalDate();

 

posted @ 2020-11-06 11:08  yvioo  阅读(13345)  评论(0编辑  收藏  举报