Commit 6eacc7f7 authored by litengwei's avatar litengwei

遥测现场问题解决

parent 7257cfc4
...@@ -1437,13 +1437,17 @@ public class TopographyController extends AbstractBaseController { ...@@ -1437,13 +1437,17 @@ public class TopographyController extends AbstractBaseController {
private Date dateParse(String value) throws ParseException { private Date dateParse(String value) throws ParseException {
String strDate = value.substring(0, 19); if(value.length() > 19) {
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC); String strDate = value.substring(0, 19);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
Date date = sdf.parse(strDate); sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String time = DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC); Date date = sdf.parse(strDate);
return sdf1.parse(time); String time = DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
return sdf1.parse(time);
} else {
return DateUtils.dateParse(value, DateUtils.DATE_TIME_PATTERN);
}
} }
/*** /***
......
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