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);
标签:threeDaysLater,JAVA,midThreeDays,01,零时,LocalDateTime,now,out 来源: https://www.cnblogs.com/xiexiaoxia/p/14329669.html