I can reproduce your problem since I am sitting in a non-english-speaking country, too. The solution is to specify English as language because your input contains an English word/abbreviation (look at the day of week "Wed"!). Following solution works:
SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH);
Date d = sdf.parse("Wed, 22 Apr 2015 05:45:42 GMT");
SimpleDateFormat out = new SimpleDateFormat("yyyy MM dd - HH:mm", Locale.ROOT);
System.out.println(out.format(d)); // output in the system timezone
It does not matter what your app is for (worldwide or not). The only fact which matters is the language of your text input. If this is varying in language then and only then you have first to determine the language of the device in question (probably Locale.getDefault()
) and set it on your SimpleDateFormat
-object.