public static String formatMillis(int millis){
  String result="";
  int hr=millis / 3600000;
  millis%=3600000;
  int min=millis / 60000;
  millis%=60000;
  int sec=millis / 1000;
  if (hr > 0) {
    result+=hr + ":";
  }
  if (min >= 0) {
    if (min > 9) {
      result+=min + ":";
    }
 else {
      result+="0" + min + ":";
    }
  }
  if (sec > 9) {
    result+=sec;
  }
 else {
    result+="0" + sec;
  }
  return result;
}

public static String formatMillis ( int millis ) { String result = "" ; int hr = millis / 3600000 ; millis %= 3600000 ; int min = millis / 60000 ; millis %= 60000 ; int sec = millis / 1000 ; if ( hr > 0 ) { result += hr + ":" ; } if ( min >= 0 ) { if ( min > 9 ) { result += min + ":" ; } else { result += "0" + min + ":" ; } } if ( sec > 9 ) { result += sec ; } else { result += "0" + sec ; } return result ; }
formats time in milliseconds to hh : mm : ss string format .
