// if the limit is set on milliseconds, and they are not supported,
// use an effective limit based on seconds
{
PeriodFormatterService pfs = BasicPeriodFormatterService.getInstance();
PeriodBuilder pb = pfs.newPeriodBuilderFactory()
.setMinLimit(2500)
.setAllowMilliseconds(false)
.getSingleUnitBuilder();
DurationFormatter df = pfs.newDurationFormatterFactory()
.setPeriodBuilder(pb)