I am working on SimpleDatFormat on android. I tried to convert time from US locale to Swedish. It is working fine in emulator but when I tested it on Samsung devices it is not working. On rest of the devices and versions it is working fine.
SimpleDateFormat inputFormat = new SimpleDateFormat("hh:mm a", Locale.US);
SimpleDateFormat outputFormat = new SimpleDateFormat("hh:mm a", new Locale("sv"));
try {
return outputFormat.format(inputFormat.parse(date));
} catch (ParseException e) {e.printStackTrace();}
return null;
Actual Result
Example input :- 06:45 AM
O/p in emulator :- 06:45 FM
O/p in real device :- 06:45 AM
Expected Result
Example input :- 06:45 AM
O/p in emulator :- 06:45 FM
O/p in real device :- 06:45 FM
Note : This issue only happens for Time locale conversion. The date conversion works fine in both real and emulator devices.
Thanks in advance.