package com.chx.disService.config;//package com.chx.eduService.config;
import java.text.SimpleDateFormat;
import java.util.Date;
public class WebConfig {
public static void main(String[] args) {
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
// System.out.println(df.format(new Date()));// new Date()为获取当前系统时间
String f0009 = "2021-04-07T06:05:31.000Z";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date = sdf.parse(f0009);//拿到Date对象
String str = sdf2.format(date);//输出格式:2018-10-23 08:13:24
System.out.println("================="+str);
} catch (Exception e) {
e.printStackTrace();
}
}
}