测试类:
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
try {
//拿到Date对象,2018-01-22T09:12:43.083Z可改为前端传过来的值
Date date = sdf1.parse("2018-01-22T09:12:43.083Z");
//输出格式:2017-01-22 09:28:33
String str = sdf2.format(date);
System.out.println(str);
} catch (Exception e) {
e.printStackTrace();
}