public static String getYesterdayByString(String day, String inFormat, String outFormat){
        try {
            SimpleDateFormat sdf = new SimpleDateFormat(inFormat);
            Date date = sdf.parse(day);
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(date);
            int calendarDay = calendar.get(Calendar.DATE);
            calendar.set(Calendar.DATE, calendarDay - 1);
            String dayBefore = new SimpleDateFormat(outFormat).format(calendar.getTime());
            return dayBefore;
        } catch (ParseException e) {
            return null;
        }
    }
@param day
@param inFormat
@param outFormat
@return String
@throws ParseException
core/src/main/java/com/dtstack/flink/sql/util/DateUtil.java