Here you can find the source of formatMillis(Long millis)
public static String formatMillis(Long millis)
//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*/ }