public static String formatDate(String dateStr, String inputFormat, String format) {
        String resultStr = dateStr;

        try {
            Date date = (new SimpleDateFormat(inputFormat)).parse(dateStr);
            resultStr = formatDate(date, format);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return resultStr;
    }
formatDate

@param dateStr String
@param inputFormat String
@param format String
@return String
inlong-common/src/main/java/org/apache/inlong/common/util/StringUtil.java