Archived Forum Post

Index of archived forum posts


JAVA/Android: How to convert the EMail Date to a java.util.Date??

May 26 '15 at 10:57

i wrote this:

String RFC822_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss Z";
DateFormat formatter = new SimpleDateFormat(RFC822_DATE_FORMAT);
CkString ckString    = new CkString();

but i got:

java.text.ParseException: Unparseable date: "Thu, 16 Apr 2015 14:45:08 GMT"

What i have to do instead?


Okay ... for all they need this: SimpleDateFormat(RFC822_DATE_FORMAT, Locale.ENGLISH);

the Locale is the Key :-)