TRX 1 rok temu
rodzic
commit
00749e088c

+ 12 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/utils/DateUtils.java

@@ -499,6 +499,18 @@ public class DateUtils {
         return null;
     }
 
+    public static Date parseStr2Date(String dateStr, String format) {
+        SimpleDateFormat longSdf = new SimpleDateFormat(format);
+        try {
+            if(StringUtils.isNotEmpty(dateStr)) {
+                return longSdf.parse(dateStr);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
     public static String getShort2Str(Date date) {
         if (date == null) {
             return null;