LocalDateTime计算时间差
生活随笔
收集整理的這篇文章主要介紹了
LocalDateTime计算时间差
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
LocalDateTime 為java8的新特性之一
LocalDateTime.now() 獲得當前時間
java.time.Durationduration
= java.time.Duration.between(LocalDateTime startTime, LocalDateTime endTime);
例如: duration.toMinutes() //兩個時間差的分鐘數
toNanos()//納秒
toMillis()//毫秒
toMinutes()//分鐘
toHours()//小時
toDays()//天數
原文地址:https://blog.csdn.net/shaoyu_zhu_88/article/details/77148557
總結
以上是生活随笔為你收集整理的LocalDateTime计算时间差的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 登机牌,机票,行程单的区别
- 下一篇: 光纤猫和路由器怎么连接 如何实现光猫和路