Ich habe ein Problem mit SimpleDateFormat
auf Android. Mit diesem Code:Android SimpleDateFormat falsches Format Android 4.x
private static final String TIME_FORMAT = "HH:mm:ss,S";
SimpleDateFormat timeFormat = new SimpleDateFormat(TIME_FORMAT, Locale.US);
String time = timeFormat.format(time.getTime());
time
hat folgendes Format "12: 30: 25.187" statt "12: 30: 25,1". Es passiert nur auf 4.x-Versionen.
Bestätigt auf meinem Gerät 4.4. Ich bin nicht sicher, ob Sie etwas dagegen tun können, abgesehen davon, dass Sie die Anzahl der Ziffern nach dem Komma überprüfen und die letzten zwei wegnehmen, wenn es drei gibt. –
bis jetzt sieht die einzige Lösung aus! – TheRedFox
Es scheint, dass es auf 5.x behoben wurde: https://code.google.com/p/android/issues/detail?id=78859&can=1&q=simpledateformat%20fractional&colspec=ID%20Status%20Priority%20Owner%20Summary% 20Stars% 20Reporter% 20Opened – assylias