【发布时间】:2014-02-02 07:33:05
【问题描述】:
我正在尝试计算两个 joda 日期之间的小时差。
val d1 = getDateTime1()
val d2 = getDateTime2()
这是我所做的:
# attemp1
val hours = Hours.hoursBetween(d1, d2) // error - types mismatch
# attempt2
val p = Period(d1, d2, PeriodType.hours()) // error - there is such a constructor
p.getHours
那么我该怎么做呢?
【问题讨论】: