|
|
|
@ -6,15 +6,15 @@ import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 时间处理类
|
|
|
|
* 时间处理类
|
|
|
|
* @author Mr Du
|
|
|
|
* @author Mr Du
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
public class DateUtils {
|
|
|
|
public class DateUtils {
|
|
|
|
private static Logger LOGGER = Logger.getLogger(DateUtils.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Format String : yyyy-MM-dd HH:mm:ss
|
|
|
|
* Format String : yyyy-MM-dd HH:mm:ss
|
|
|
|
@ -85,7 +85,7 @@ public class DateUtils {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ret = sdf.format(date);
|
|
|
|
ret = sdf.format(date);
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
LOGGER.error(ex, ex);
|
|
|
|
log.error("日期格式转换失败", ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -129,7 +129,7 @@ public class DateUtils {
|
|
|
|
String integerDate = stringDate.replaceAll("/", "").replaceAll("年", "").replaceAll("月", "").replaceAll("日", "").replaceAll(":", ":");
|
|
|
|
String integerDate = stringDate.replaceAll("/", "").replaceAll("年", "").replaceAll("月", "").replaceAll("日", "").replaceAll(":", ":");
|
|
|
|
ret = sdf.parse(integerDate);
|
|
|
|
ret = sdf.parse(integerDate);
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
LOGGER.error(ex, ex);
|
|
|
|
log.error("日期格式转换失败", ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|