改写的 formatElapsedTime

private static final int SECONDS_PER_MINUTE = 60;
private static final int SECONDS_PER_HOUR = 60 * 60;
private static final int SECONDS_PER_DAY = 24 * 60 * 60;

public static String formatElapsedTime(long millis) {
    long secondsLong = millis / 1000;

    int days, hours, minutes;
    days=(int)(secondsLong/SECONDS_PER_DAY);
    secondsLong %= SECONDS_PER_DAY;
    hours=(int)(secondsLong/SECONDS_PER_HOUR);
    secondsLong %= SECONDS_PER_HOUR;
    minutes=(int)(secondsLong/SECONDS_PER_MINUTE);
    int seconds=(int)(secondsLong % SECONDS_PER_MINUTE);

    if(days==0){
    	if(hours==0){
    		if(minutes==0)return String.format("%ds", seconds);
    		return String.format("%dmin %ds", minutes,seconds);
    	}
    	return String.format("%dh %dmin", hours,minutes);
    }
    return String.format("%dd %dh %dmin", days,hours,minutes);
}