I have a method which determines the period between two dateTime variables.
Period period = new Period(startTime, endTime);
PeriodFormatter runDurationFormatter = new PeriodFormatterBuilder().printZeroAlways().minimumPrintedDigits(2).appendDays().appendSeparator(":").appendHours().appendSeparator(":").appendMinutes().appendSeparator(":").appendSeconds().toFormatter();
return runDurationFormatter.print(period);
I would expect to see 00:01:00 for 1 minute, 23:00:00 for 23 hours, 30:00:00 for 30 hours, and 120:00:00 for 120 hours (5 days). I tried using
Period daystoHours = period.normalizedStandard(PeriodType.time());
But eclipse shows that normalizedStandard() method is undefined for type period.