<commit_before>package cn.ben.tvdemo.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class TimeUtil {
    public static final String FORMAT_YEAR_MONTH_DAY = "yyyy-MM-dd";
    public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE = "yyyy-MM-dd HH:mm";

    private TimeUtil() {
    }

    public static String plusOnCurrentDate(int inc) {
        Date date = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DATE, inc);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FORMAT_YEAR_MONTH_DAY, Locale.getDefault());
        return simpleDateFormat.format(calendar.getTime());
    }

    public static String date2String(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
        return sdf.format(date);
    }

    public static Date string2Date(String dateStr, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
        try {
            return sdf.parse(dateStr);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}<commit_msg>TimeUtil<commit_after>package cn.ben.tvdemo.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class TimeUtil {
    public static final String FORMAT_YEAR_MONTH_DAY = "yyyy-MM-dd";
    public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE = "yyyy-MM-dd HH:mm";
    private static final Calendar mCalendar = Calendar.getInstance();

    private TimeUtil() {
    }

    public static String plusOnDate(String date, int inc, String inputFormat, String outputFormat) {
        mCalendar.setTime(string2Date(date, inputFormat));
        mCalendar.add(Calendar.DATE, inc);
        return date2String(mCalendar.getTime(), outputFormat);
    }

    public static String plusOnCurrentDate(int inc, String outputFormat) {
        mCalendar.setTime(new Date());
        mCalendar.add(Calendar.DATE, inc);
        return date2String(mCalendar.getTime(), outputFormat);
    }

    public static String date2String(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
        return sdf.format(date);
    }

    public static Date string2Date(String dateStr, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
        try {
            return sdf.parse(dateStr);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
{'fraction_non_alphanumeric': 0.09582132564841499, 'fraction_numerical': 0.002521613832853026, 'mean_word_length': 3.2592024539877302, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6265314', 'n_tokens_mistral': 800, 'n_tokens_neox': 784, 'n_words': 190}