优化
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
@ -163,6 +164,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
|
||||
public static LocalDate str2Localdate(String time,String format){
|
||||
// 定义日期格式
|
||||
if(StrUtil.isBlank(time)){
|
||||
return null;
|
||||
}
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
LocalDate localDate = null;
|
||||
try {
|
||||
|
Reference in New Issue
Block a user