public static String getDateByMS(long longMS) { //long day = 0l;//天 long hour = 0l;//时 long minute = 0l;//分 long second = 0l;//秒 String H = "00"; String M = "00"; String S = "00"; //long millisecond = 0l;//毫秒 //millisecond = longMS%1000; System.out.println(longMS); second = longMS / 1000; if (second >= 60) { minute = second / 60; second = second % 60; if (minute >= 60) { hour = minute / 60; minute = minute % 60; } } if (hour <= 9L) { H = "0" + hour; } else { H = String.valueOf(hour); } if (minute <= 9L) { M = "0" + minute; } else { M = String.valueOf(minute); } if (second <= 9L) { S = "0" + second; } else { S = String.valueOf(second); } return H + ":" + M + ":" + S; }