Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6660)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6661)
@@ -833,30 +833,36 @@
      * Returns a simple human readable (hours, minutes, seconds) string for a given duration in milliseconds.
      * @param elapsedTime The duration in milliseconds
-     * @return A human redable string for the given duration
+     * @return A human readable string for the given duration
      * @throws IllegalArgumentException if elapsedTime is < 0
      * @since 6354
      */
     public static String getDurationString(long elapsedTime) throws IllegalArgumentException {
+        final int MILLIS_OF_SECOND = 1000;
+        final int MILLIS_OF_MINUTE = 60000;
+        final int MILLIS_OF_HOUR = 3600000;
+        final int MILLIS_OF_DAY = 86400000;
         if (elapsedTime < 0) {
             throw new IllegalArgumentException("elapsedTime must be > 0");
         }
         // Is it less than 1 second ?
-        if (elapsedTime < 1000) {
+        if (elapsedTime < MILLIS_OF_SECOND) {
             return String.format("%d %s", elapsedTime, tr("ms"));
         }
         // Is it less than 1 minute ?
-        if (elapsedTime < 60*1000) {
-            return String.format("%.1f %s", elapsedTime/1000f, tr("s"));
+        if (elapsedTime < MILLIS_OF_MINUTE) {
+            return String.format("%.1f %s", elapsedTime / (float) MILLIS_OF_SECOND, tr("s"));
         }
         // Is it less than 1 hour ?
-        if (elapsedTime < 60*60*1000) {
-            return String.format("%d %s %d %s", elapsedTime/60000, tr("min"), elapsedTime/1000, tr("s"));
+        if (elapsedTime < MILLIS_OF_HOUR) {
+            final long min = elapsedTime / MILLIS_OF_MINUTE;
+            return String.format("%d %s %d %s", min, tr("min"), (elapsedTime - min * MILLIS_OF_MINUTE) / MILLIS_OF_SECOND, tr("s"));
         }
         // Is it less than 1 day ?
-        if (elapsedTime < 24*60*60*1000) {
-            return String.format("%d %s %d %s", elapsedTime/3600000, tr("h"), elapsedTime/60000, tr("min"));
-        }
-        long days = elapsedTime/86400000;
-        return String.format("%d %s %d %s", days, trn("day", "days", days), elapsedTime/3600000, tr("h"));
+        if (elapsedTime < MILLIS_OF_DAY) {
+            final long hour = elapsedTime / MILLIS_OF_HOUR;
+            return String.format("%d %s %d %s", hour, tr("h"), (elapsedTime - hour * MILLIS_OF_HOUR) / MILLIS_OF_MINUTE, tr("min"));
+        }
+        long days = elapsedTime / MILLIS_OF_DAY;
+        return String.format("%d %s %d %s", days, trn("day", "days", days), (elapsedTime - days * MILLIS_OF_DAY) / MILLIS_OF_HOUR, tr("h"));
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 6660)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 6661)
@@ -9,4 +9,5 @@
 import java.net.URL;
 import java.util.Arrays;
+import java.util.Locale;
 
 import static org.hamcrest.CoreMatchers.is;
@@ -99,3 +100,15 @@
         assertThat(Utils.getPositionListString(Arrays.asList(1, 5, 2, 6, 7)), is("1-2,5-7"));
     }
+
+    @Test
+    public void testDurationString() throws Exception {
+        Locale.setDefault(Locale.ENGLISH);
+        assertThat(Utils.getDurationString(123), is("123 ms"));
+        assertThat(Utils.getDurationString(1234), is("1.2 s"));
+        assertThat(Utils.getDurationString(57 * 1000), is("57.0 s"));
+        assertThat(Utils.getDurationString(507 * 1000), is("8 min 27 s"));
+        assertThat(Utils.getDurationString((long) (8.4 * 60 * 60 * 1000)), is("8 h 24 min"));
+        assertThat(Utils.getDurationString((long) (1.5 * 24 * 60 * 60 * 1000)), is("1 day 12 h"));
+        assertThat(Utils.getDurationString((long) (8.5 * 24 * 60 * 60 * 1000)), is("8 days 12 h"));
+    }
 }
