Following is the code to parse date. I have used 'joda-time:joda-time:2.9.9' lib for formatter.
String date = "Sun Sep 04 17:29:52 +0000 2022";
DateTimeFormatter dateFormat = DateTimeFormat.forPattern("EEE MMM dd HH:mm:ss Z
yyyy").withLocale(Locale.UK);
dateFormat.parseDateTime(date);
Above code was throwing illegelArgument exception in Android 12. When I changed locale from UK to US, its started working.
But strange thing is that if I tried to parse Wed Mar 23 14:28:32 +0000 2016 this date with above code, its working in all OS.
Out of mind question is why one date is getting parse and another is not.
What's actually changed in Android 12 that suddenly code is getting failed?