package com.friday.custody.service.trustService.gtja.utils;

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

/**
 * @Description
 * @Author wulifeng
 * @Date: 2022/3/14
 */
public class DateUtil {
    public static String transferDateFormat(String originFormat,String changedFormat,String date){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(originFormat);
        SimpleDateFormat dateFormat = new SimpleDateFormat(changedFormat);
        try {
            Date parse = simpleDateFormat.parse(date);
            String rightDate = dateFormat.format(parse);
            return rightDate;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
