I would like to convert my string date to int but I get an error, example of my date 'dim. janv. 23 24:00:00 +0000 2011` This is part of my code :
String created_at = (String) jsonObject.get("created_at");
System.out.println("la date de création de tweet est: " + created_at);
DateFormat df = new SimpleDateFormat(" ddd. MMMM. EE HH:mm:ss z yyyy");
String s= df.format(created_at);
int out=Integer.valueOf(s);
System.out.println("new date " +out);
And the output is:
See Question&Answers more detail:osjava.lang.IllegalArgumentException: Cannot format given Object as a Date.