我检索HTTP响应头的最后修改值,并试图为字符串的日期值转换为Date对象时:无法解析的日期例外传递字符串日期
..
URLConnection urlConnection = url.openConnection();
Map<String, List<String>> headers = urlConnection.getHeaderFields();
Date date = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH).parse(headers.get(LAST_MODIFIED).get(0));
这是抛出异常:
java.text.ParseException:无法解析的日期: “星期四,2011年10月27日13时09分24秒 GMT” 在java.text.DateFormat.parse(DateFormat.java:337)
有人可以发现这个问题?!谢谢。
编辑。
[Java字符串到日期转换]的可能重复(http://stackoverflow.com/questions/4216745/java-string-to-date-conversion) – Bitmap