调用接口, 得到的时间是以下格式的:
String time = “2018-08-13T15:58:35+0800”;
使用工具类进行转换
public static Date TzFormat(String oldDate)throws ParseException{
Date date1 = null;
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
Date date = df.parse(oldDate);
SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.US);
date1 = df1.parse(date.toString());
return date1;
}