diff --git a/src/main/java/org/ids_mannheim/Progressbar.java b/src/main/java/org/ids_mannheim/Progressbar.java
index 8b57cb9..c036d99 100644
--- a/src/main/java/org/ids_mannheim/Progressbar.java
+++ b/src/main/java/org/ids_mannheim/Progressbar.java
@@ -4,20 +4,22 @@
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.Date;
 
 public class Progressbar {
     private static final int width = 40;
     //    private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-    private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("ccc dd. LLL HH:mm:ss");
+    private static final DateTimeFormatter longFormatter = DateTimeFormatter.ofPattern("ccc dd. LLL HH:mm");
+    private static final DateTimeFormatter shortFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
     private final long max;
     private final long start;
     private long current;
     private long lastUpdate;
 
-    public Progressbar(long max, String name) {
+    public Progressbar(long max) {
         this.start = System.currentTimeMillis();
         this.max = max;
-        System.err.println(name + ":");
         this.printBar(false);
     }
 
@@ -34,12 +36,30 @@
         this.printBar(true);
     }
 
+    private static boolean isSameDay(LocalDateTime date1, Date date2) {
+        Instant instant1 = date1.toInstant(ZoneId.systemDefault().getRules().getOffset(date1))
+                .truncatedTo(ChronoUnit.DAYS);
+        Instant instant2 = date2.toInstant()
+                .truncatedTo(ChronoUnit.DAYS);
+        return instant1.equals(instant2);
+    }
+
+    public static boolean isToday(LocalDateTime date) {
+        return isSameDay(date, new Date());
+    }
+
     public String shortDateTimeFromMillis(long millis) {
+        if(millis < 0) {
+            return "";
+        }
         LocalDateTime date = LocalDateTime.ofInstant(Instant.ofEpochMilli(millis), ZoneId.systemDefault());
-        return date.format(formatter);
+        return date.format(isToday(date)? shortFormatter: longFormatter);
     }
 
     public String hmsFromMillis(long millis) {
+        if(millis < 0) {
+            return "--:--:--";
+        }
         int seconds = (int) (millis / 1000) % 60;
         int minutes = (int) (millis / 1000) % 3600 / 60;
         int hours = (int) (millis / 1000) / 3600;
@@ -72,7 +92,7 @@
                 hmsFromMillis(elapsed),
                 hmsFromMillis(ttg),
                 shortDateTimeFromMillis(start + elapsed + ttg)
-                ));
+        ));
         if (finished) {
             System.err.print("\n");
         }
diff --git a/src/main/java/org/ids_mannheim/TotalNGram.java b/src/main/java/org/ids_mannheim/TotalNGram.java
index 47c4ec1..44bd6e1 100644
--- a/src/main/java/org/ids_mannheim/TotalNGram.java
+++ b/src/main/java/org/ids_mannheim/TotalNGram.java
@@ -110,7 +110,7 @@
         FoldedEntry.setFolds(FOLDS);
         ConcurrentHashMap<String, FoldedEntry> map = new ConcurrentHashMap<>();
         long totalFilesSizes = inputFiles.parallelStream().mapToLong(fname -> new File(fname).length()).sum();
-        etaPrinter = new Progressbar(totalFilesSizes, "MB");
+        etaPrinter = new Progressbar(totalFilesSizes);
         BlockingQueue<Integer> queue = new LinkedBlockingQueue<>(inputFiles.size());
         ExecutorService es = Executors.newCachedThreadPool();
         WorkerNodePool workerNodePool = new WorkerNodePool(worker_pool_specification);
