I get a time string like "Thu, 11 Aug 2016 00:33:30 GMT".And I want to convert it to a Date object in Java. I do it with the code:
String timeString= "Thu, 11 Aug 2016 00:33:30 GMT";
SimpleDateFormat inputFormat = new SimpleDateFormat
("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.CHINA);
inputFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date= null;
try {
date = inputFormat.parse(timeString);
System.out.println(date.toString());
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
But I got a "java.text.ParseException: Unparseable date: 'Thu, 11 Aug 2016 00:33:30 GMT'" exception. Is everyone know why?Thanks a lot...