import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* 日期字符串格式化输出
*
* @param input
* @param inputFormat yyyyMMdd yyyy-MM-dd
* @param outputFormat
* @return
*/
public static String dateCharFormat(String input, String inputFormat, String outputFormat) {
if (StringUtils.isBlank(input)) {
return null;
}
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern(inputFormat);
LocalDate localDate = LocalDate.parse(input, inputFormatter);
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormat);
return localDate.format(outputFormatter);
}