Here you can find the source of toMillisToDayTime(long mill)
public static String toMillisToDayTime(long mill)
//package com.java2s; //License from project: Apache License public class Main { public static String toMillisToDayTime(long mill) { String timeString = ""; mill = mill / 1000;//from ww w.j a v a 2s . c om int days = (int) (mill / 60 / 60 / 24); if (days > 0) { timeString += days + " Day "; } else { timeString += 0 + " Day "; } int dayTime = days * 24 * 60 * 60; int hours = (int) ((mill - dayTime) / 60 / 60); if (hours < 10) { timeString += "0" + hours + ":"; } else { timeString += hours + ":"; } int minutes = (int) ((mill - dayTime - 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; } }