DateUtils.formatElapsedTime(): fixup previous change

The function actually gets seconds, not milliseconds. So the
implementation was already correct before the recent change.
Just the argument naming was wrong.
This commit is contained in:
Julian Winkler
2025-09-03 19:19:33 +02:00
parent a24ab435a8
commit 996c52394c

View File

@@ -17,13 +17,13 @@ public class DateUtils {
return d1.getYear() == d2.getYear() && d1.getMonth() == d2.getMonth() && d1.getDate() == d2.getDate(); return d1.getYear() == d2.getYear() && d1.getMonth() == d2.getMonth() && d1.getDate() == d2.getDate();
} }
public static String formatElapsedTime(long elapsedMillis) { public static String formatElapsedTime(long elapsedSeconds) {
final long days = elapsedMillis / (24 * 60 * 60L * 1000L); final long days = elapsedSeconds / (24 * 60 * 60L);
final long hours = elapsedMillis / (60 * 60L * 1000L) % 24L; final long hours = elapsedSeconds / (60 * 60L) % 24L;
final long minutes = elapsedMillis / (60L * 1000L) % 60L; final long minutes = elapsedSeconds / (60L) % 60L;
final long seconds = elapsedMillis / 1000L % 60L; final long seconds = elapsedSeconds % 60L;
if (elapsedMillis < 0) { if (elapsedSeconds < 0) {
return "0:00"; return "0:00";
} else if (days > 0) { } else if (days > 0) {
return String.format("%d:%02d:%02d:%02d", days, hours, minutes, seconds); return String.format("%d:%02d:%02d:%02d", days, hours, minutes, seconds);