I want to display date according to each country's date format. I have tried many ways finally I found this example
http://www.java2s.com/Code/Java/Data-Type/DateFormatwithLocale.htm
Which gives the perfect output of what I meant. Some countries like Germany won't use 12hr formats instead they uses 24 hr formats with no AM/PM. While some countries like US uses 12hr formats.
But I found that while running this java class it returns the correct output as expected but while running this inside an Android project it returns something like this
I/System.out: Locale: en_US
I/System.out: Jan 23, 2018 5:26:41 AM
I/System.out: Jan 23, 2018 5:26:41 AM
I/System.out: Jan 23, 2018 5:26:41 AM
I/System.out: Jan 23, 2018 5:26:41 AM
I/System.out: Jan 23, 2018 5:26:41 AM
I/System.out: Locale: de_DE
I/System.out: 23.01.2018 5:26:41 vorm.
I/System.out: 23.01.2018 5:26:41 vorm.
I/System.out: 23.01.2018 5:26:41 vorm.
I/System.out: 23.01.2018 5:26:41 vorm.
I/System.out: 23.01.2018 5:26:41 vorm.
In case of Locale: en_US it is as expected but in case of Locale: de_DE it is expected not to have that “vorm.”.
Could anyone explain this behavior?