public static Instant minus(final Instant instant, final DataRetentionRule rule) {
        if (rule.isForever()) {
            return Instant.EPOCH;
        }

        final LocalDateTime age;
        final LocalDateTime time = LocalDateTime.ofInstant(instant, ZoneOffset.UTC);
        switch (rule.getTimeUnit()) {
            case MINUTES:
                age = time.minusMinutes(rule.getAge());
                break;
            case HOURS:
                age = time.minusHours(rule.getAge());
                break;
            case DAYS:
                age = time.minusDays(rule.getAge());
                break;
            case WEEKS:
                age = time.minusWeeks(rule.getAge());
                break;
            case MONTHS:
                age = time.minusMonths(rule.getAge());
                break;
            case YEARS:
                age = time.minusYears(rule.getAge());
                break;
            default:
                age = null;
        }

        if (age == null) {
            return Instant.EPOCH;
        }

        return age.toInstant(ZoneOffset.UTC);
    }
Subtracts the rule's age from the instant, e.g. now() - 30d
stroom-data/stroom-data-retention-api/src/main/java/stroom/data/retention/api/DataRetentionCreationTimeUtil.java