LocalDateTime now = LocalDateTime.now();
System.out.println(now); //2019-10-21T18:47:01.221
Instant instant = now.atZone(ZoneId.systemDefault()).toInstant();
Date from = Date.from(instant);
System.out.println(from); //Mon Oct 21 18:47:01 CST 2019
java8时间类型转成Date类型
最新推荐文章于 2023-06-13 11:20:50 发布