public static int getPrecision(final long duration, int pointsRequired) {
        final double durationLog = Math.log10(duration);
        final double pointLog = Math.log10(pointsRequired);
        return (int) (durationLog - pointLog);
    }
Create a date in the same way.

@param year  e.g. 2001
@param month e.g. 01
@param day   e.g. 31
stroom-util/src/main/java/stroom/util/PeriodUtil.java