Here you can find the source of elapsedTimeString(long time)
public static String elapsedTimeString(long time)
//package com.java2s; //License from project: Open Source License public class Main { public static String elapsedTimeString(long time) { final long DAY = 86400000; final long HOUR = 3600000; final long MIN = 60000; long remaintime = time; long days = remaintime / DAY; remaintime = remaintime - DAY * days; long hours = remaintime / HOUR; remaintime = remaintime - HOUR * hours; long mins = remaintime / MIN; remaintime = remaintime - MIN * mins; long secs = remaintime / 1000; remaintime = remaintime - 1000 * secs; String timeString = "" + days + "d:" + hours + "h:" + mins + "m:" + secs + "s:" + remaintime; return timeString; }/* ww w. j a v a 2 s . c om*/ }