I'm trying to parse a String
value in the format Sat Dec 03 20:30:33 GMT+00:00 2016
to a Date
variable, but I'm getting an java.text.ParseException: Unparseable date: "Sat Dec 03 20:30:33 GMT+00:00 2016" (at offset 0)
exception. What am I doing wrong here?
Date itemDate = new Date();
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss");
try {
itemDate = df.parse(c.getString(c.getColumnIndexOrThrow(ArticlesContract.ArticleEntry.COLUMN_NAME_DATE)));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}