I have a problem while trying to parse the expiration date of the facebook access token with the joda time library. This is what my method looks like:
public static DateTime parseDate(String date_string){
DateTime dateTime = DateTime.parse(date_string, DateTimeFormat.forPattern("EEE MMM dd HH:mm:ss zzz yyyy"));
return dateTime;
}
I'm calling the method like this:
DateTime fb_token_expire_date;
fb_token_expire_date = parseDate(fb_token_expire_date_str);
the fb_token_expire_date_str looks like this in my case: "Tue Jan 06 14:15:21 OEZ 2015"
But when i'm trying to run the programm i get this error:
Caused by: java.lang.IllegalArgumentException: Invalid format: "Tue Jan 06 14:15:21 OEZ 2015"
at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:899)
at org.joda.time.DateTime.parse(DateTime.java:160)
i have the feeling that it has something to do with the timezone, but i don't know how to fix it. I hope you can help me.