String gmt_created = item.getGmt_created(); try { getDateFormat(gmt_created); } catch (ParseException e) { e.printStackTrace(); } public void getDateFormat(String oldDateStr) throws ParseException { //此格式只有 jdk 1.7才支持 yyyy-MM-dd'T'HH:mm:ss.SSSXXX //yyyy-MM-dd'T'HH:mm:ss.SSSZ DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); Date date = df.parse(oldDateStr); Log.e("TAG1", date.toString()); // SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK); // Log.e("TAG2", df1.format(date)); DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); Log.e("TAG3", df2.format(date)); tvGmtCreated.setText(df2.format(date)); }