ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime localDateTime = LocalDateTime.now();
localDateTime = localDateTime.plusSeconds(1);
ZonedDateTime zdt = localDateTime.atZone(zoneId);
Date date = Date.from(zdt.toInstant());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String s = dateFormat.format(date);
System.out.println(s);
LocalDateTime转化Date
最新推荐文章于 2023-01-06 18:14:24 发布