JAVA 取当前系统时间后三天零时(LocalDateTime)

//当前系统时间
LocalDateTime now = LocalDateTime.now();
//输出now:2021-01-26T12:22:21.319
System.out.println(now);
//当前系统时间三天后
LocalDateTime threeDaysLater = now.plusDays(3);
//输出threeDaysLater:2021-01-29T12:22:21.319
System.out.println(threeDaysLater);
//当前系统时间三天后零时
LocalDateTime midThreeDays= LocalDateTime.of(threeDaysLater.toLocalDate(), LocalTime.MIN);
//输出midThreeDays:2021-01-29T00:00
System.out.println(midThreeDays);
上一篇:CSS3中的动画效果记录


下一篇:LocalDateTime计算时间差