LocalDateTime

https://www.cnblogs.com/Fantasyfzg/p/16922173.html

LocalDateTime.parse

https://blog.csdn.net/WXF_Sir/article/details/112302690

 LocalDateTime 转data
       // 创建一个LocalDateTime实例
        LocalDateTime localDateTime = LocalDateTime.now();
 
        // 转换为java.util.Date
        // 默认时区,也可以指定时区
        Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
 
        System.out.println("LocalDateTime: " + localDateTime);
        System.out.println("Date: " + date);
posted @ 2023-04-12 08:53  寒冷的雨呢  阅读(70)  评论(0编辑  收藏  举报