Date类型转换成LocalDateTime 类型

Date to LocalDateTime:

        Date currDate = new Date();
        LocalDateTime ldt = currDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
        System.out.println(ldt);
输出:

2020-01-19T15:41:02.048

  

posted @ 2021-09-28 14:04  红尘沙漏  阅读(1146)  评论(0编辑  收藏  举报