Commit ba1c256a authored by Quxl's avatar Quxl

x

parent 355f14f2
......@@ -30,7 +30,7 @@ public class DateUtil {
public static Object parseDate(String dateString, String fmt) {
if ("00000000".equals(dateString)) {
return "0000-00-00";
} else {
} else {
try {
DateFormat df = getFmt(fmt);
return df.parse(dateString);
......@@ -41,13 +41,11 @@ public class DateUtil {
}
public static Object parseDateNoEmpty(String dateString, String fmt) {
Object res;
if (dateString != null && !dateString.equals("")) {
res = parseDate(dateString, fmt);
return parseDate(dateString, fmt);
} else {
res = new Date(0);
return "0000-00-00";
}
return res;
}
public static DateFormat getFmt(String fmt) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment