|
@@ -7,10 +7,15 @@
|
|
|
|
|
|
package cn.com.qmth.examcloud.app.core.utils;
|
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
|
|
|
public class DateUtils {
|
|
|
+ private static Logger log = LoggerFactory.getLogger(DateUtils.class);
|
|
|
+
|
|
|
private static final String fmt = "yyyy-MM-dd HH:mm:ss";
|
|
|
|
|
|
public static String formatLongDate(String longStr) {
|
|
@@ -19,7 +24,7 @@ public class DateUtils {
|
|
|
Date date = new Date(value);
|
|
|
return new SimpleDateFormat(fmt).format(date);
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
return longStr;
|
|
|
}
|
|
|
}
|
|
@@ -28,7 +33,7 @@ public class DateUtils {
|
|
|
try {
|
|
|
return new SimpleDateFormat(fmt).format(date);
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
return null;
|
|
|
}
|
|
|
}
|