I am trying to test that my Android app formats dates correctly according to locale. For example, I would expect it to show:
"Nov 07" in U.S. (what I see currently) versus "07 Nov" in U.K.
No matter what I do, the date on my device and all apps is always formatted MM/DD and won't change. How can I change the locale so that I can test that different date formats show up properly?
I have tried spoofing my location to U.K. using VPN, and also tried changing:
System > Date & time > Time zone --> to United Kingdom
I am using Pixel 2 device with Android 11.
If it helps, my code:
DateUtils.formatDateTime(context, timestamp.millis(), DateUtils.FORMAT_SHOW_DATE or DateUtils.FORMAT_NO_YEAR or FORMAT_ABBREV_MONTH)