jpfss

LocalDateTime 为java8的新特性之一


LocalDateTime.now() 获得当前时间

java.time.Duration duration = 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


分类:

技术点:

相关文章:

  • 2021-06-08
  • 2021-06-14
  • 2022-02-04
  • 2021-09-28
  • 2022-02-10
  • 2021-09-07
  • 2022-02-09
  • 2022-01-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-12-09
  • 2022-02-27
相关资源
相似解决方案