Here you can find the source of toMillisToKKMMSSTime(long mill)
public static String toMillisToKKMMSSTime(long mill)
//package com.java2s; //License from project: Apache License public class Main { public static String toMillisToKKMMSSTime(long mill) { String timeString = ""; mill = mill / 1000;//from www .j av a 2 s. c om int hours = (int) (mill / 60 / 60); if (hours < 10) { timeString += "0" + hours + ":"; } else { timeString += hours + ":"; } int minutes = (int) ((mill - hours * 60 * 60) / 60); if (minutes < 10) { timeString += "0" + minutes + ":"; } else { timeString += minutes + ":"; } int seconds = (int) (mill % 60); if (seconds < 10) { timeString += "0" + seconds; } else { timeString += seconds; } return timeString; } }