public static String millisToString(long millis){
  boolean negative=millis < 0;
  millis=Math.abs(millis);
  millis/=1000;
  int sec=(int)(millis % 60);
  millis/=60;
  int min=(int)(millis % 60);
  millis/=60;
  int hours=(int)millis;
  String time;
  DecimalFormat format=(DecimalFormat)NumberFormat.getInstance(Locale.US);
  format.applyPattern("00");
  if (millis > 0) {
    time=(negative ? "-" : "") + hours + ":"+ format.format(min)+ ":"+ format.format(sec);
  }
 else {
    time=(negative ? "-" : "") + min + ":"+ format.format(sec);
  }
  return time;
}

public static String millisToString ( long millis ) { boolean negative = millis < 0 ; millis = Math . abs ( millis ) ; millis /= 1000 ; int sec = ( int ) ( millis % 60 ) ; millis /= 60 ; int min = ( int ) ( millis % 60 ) ; millis /= 60 ; int hours = ( int ) millis ; String time ; DecimalFormat format = ( DecimalFormat ) NumberFormat . getInstance ( Locale . US ) ; format . applyPattern ( "00" ) ; if ( millis > 0 ) { time = ( negative ? "-" : "" ) + hours + ":" + format . format ( min ) + ":" + format . format ( sec ) ; } else { time = ( negative ? "-" : "" ) + min + ":" + format . format ( sec ) ; } return time ; }
convert time to a string
