Java Millisecond Format formatMillis(Long millis)

Here you can find the source of formatMillis(Long millis)

Description

format Millis

License

Creative Commons License

Declaration

public static String formatMillis(Long millis) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    public static String formatMillis(Long millis) {
        long seconds = millis / 1000;
        long minutes = seconds / 60;
        long hours = minutes / 60;
        long days = hours / 24;
        return days + " days " + hours % 24 + " hours " + minutes % 60 + " min " + seconds % 60 + " sec";
    }/*from w w w.  j  a v a2s. c  o  m*/
}

Related

  1. formatMillis(int millis, int digits)
  2. formatMillis(long duration)
  3. formatMillis(long millis)
  4. formatMillis(long millis)
  5. formatMillis(long millis)
  6. formatMillis(long millis)
  7. formatMillis(long t)
  8. formatMillis(long time)
  9. formatMillis(long time, boolean showMillis)