jdk8 LocalDateTime 计算时间差

1.计算时间差,精确到秒    出参类型为long

Duration.between(startTime,endTime)

.toDays()   //转为天

.toHours()  //转为小时

.toMinutes()  //转为分钟

.toMillis()//毫秒

2.

posted @ 2021-01-05 14:13  wangssd  阅读(1113)  评论(0编辑  收藏  举报