String dateSt = "Sun Dec 31 10:30:00 IST 2017";
DateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");
Date date = (Date)formatter.parse(dateSt);
DateFormat ft= new SimpleDateFormat("YYYYMMdd");
String dateStr = ft.format(date);
System.out.println("New Date =="+dateStr);
输出:20181231
应该是20171231
需要帮助..