The code does exactly same date formatting for "anon" vs. "regular" forwarding vs. "reply":
DateFormat format;
format = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.MEDIUM);
return format.format(new Date(when));
The issue of 12 vs. 24 hour formatting has come up before, and back then we discovered a bug on this in the Android bug tracker.
http://www.aqua-mail.com/forum/index.php?topic=3815.0
https://code.google.com/p/android/issues/detail?id=181201
Something is very strange then. I just created an empty project from the default Android Studio template whose only purpose is to print the result of the code you use:
https://github.com/samueltardieu/DateTestThe exercized code is
https://github.com/samueltardieu/DateTest/blob/master/app/src/main/java/rfc1149/net/datetest/MainActivity.java#L34-L41On the same device (Nexus 5X using Android 7.0), without altering anything in settings between repeated runs of both applications (both killing and not killing them in-between), AquaMail displays "15 septembre 2016 9:49:15 PM" when anonforwarding/regularforwarding/replying, and DateTest (the test application) "15 septembre 2016 21:49:15".
It is possible that AquaMail somehow changes something within its application context that makes the system resort to using a 12 hour format. Does it do any `Locale.setLocale()` by chance even when the default locale is selected in AquaMail? If the Android runtime was just plain bogus, then the DateTest application should exhibit the same problem.
I also tried changing the targetSdkVersion and the minSdkVersion in the DateTest application to see if it changes anything, but it doesn't, I cannot reproduce AquaMail behaviour within the test application with the same code.