实验报告

This commit is contained in:
ls
2025-05-04 15:09:57 +08:00
parent 47461a5d6c
commit 808f938ada
8 changed files with 164 additions and 19 deletions

View File

@@ -436,6 +436,15 @@ public class DateUtils extends PropertyEditorSupport {
return getSdFormat(pattern).format(getCalendar().getTime());
}
public static String formatDate(String dateStr, String pattern) {
try {
Date date = parseDate(dateStr, "yyyy-MM-dd HH:mm");
return getSdFormat(pattern).format(date);
} catch (ParseException e) {
return dateStr;
}
}
/**
* 指定日期按指定格式显示
*