public static IntervalInfo parseIntervalInfo(DateTimeFormatter dateTimeFormatter, String dateStr, int factor) {
        TemporalAccessor temporalAccessor = dateTimeFormatter.parse(dateStr);
        HashMap<ChronoField, Long> map = new HashMap<>();
        for (ChronoField field : CHRONO_FIELD_LIST) {
            try {
                long num = temporalAccessor.getLong(field);
                if (num == 0) {
                    continue;
                }
                map.put(field, temporalAccessor.getLong(field));
            } catch (Exception ignored) {

            }
        }
        return new IntervalInfo(factor, map);
    }
Time calculation

@param dateStr      Time parameter string
@param intervalInfo Interval parsing results
@param isPositive   True is positive, false is negative
@return Calculation result string
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/utils/DateUtil.java