java如何处理2016-09-03T00:00:00.000+08:00时间格式

public class DealDateFormatUtil {

public static String dealDate(String oldDateStr) throws ParseException {
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    Date date = df.parse(oldDateStr);
    SimpleDateFormat df1 = new SimpleDateFormat ("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
    Date date1 =  df1.parse(date.toString());
    DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    return df2.format(date1);
}

}

你可能感兴趣的:(java知识)