|
|
@@ -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;
|