I am seeing some strange behavior around the Joda-time Period
class -- specifically the days processing. In the following example code, I am specifying a period of 26 hours as milliseconds.
// 26 hour duration
long durationMillis = 26 * 3600 * 1000;
Period period = new Period(durationMillis, PeriodType.dayTime());
// this fails because days == 0
assertEquals(1, period.getDays());
// this would fail because hours == 26
assertEquals(2, period.getHours());
I was expecting that Period
would see that 26 hours is 1 day and 2 hours but it doesn't seem to be recognizing that a day == 24 hours.
Any idea what am I doing wrong?