天
period.getDays();
小时
period.getHours();
分钟
period.getMinutes();
秒
period.getSeconds();
天的另一种方式
Days.daysBetween(A, B).getDays(); //得到的是 B - A的天数
以上是两个时间的差值,如果
A:2017-06-01 12:00:00
B:2017-06-02 00:00:00
period.getDays();
Days.daysBetween(A, B).getDays();
结果都是0
Days.daysBetween(A.withTimeAtStartOfDay(), B.withTimeAtStartOfDay()).getDays();
结果是1