public static long parseToMilliseconds(final String value) {
        if (value == null) {
            throw new DateTimeParseException(PARSE_ERROR_MESSAGE, "null", 0);
        }
        if (NullSafe.isBlankString(value)) {
            throw new DateTimeParseException(PARSE_ERROR_MESSAGE, value, 0);
        }
        try {
            if (value.startsWith("P")) {
                // This is ISO 8601 format so use Duration to parse it
                return Duration.parse(value).toMillis();
            }
            // Not ISO 8601 so have a go with our ModelStringUtil format
            return ModelStringUtil.parseDurationString(value);
        } catch (DateTimeParseException e) {
            throw e;
        } catch (Exception e) {
            throw new DateTimeParseException(PARSE_ERROR_MESSAGE, value, 0);
        }
    }
@throws DateTimeParseException if value is null or can't be parsed for any reason.
stroom-query/stroom-query-language/src/main/java/stroom/query/language/functions/ValDurationUtil.java