question: 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 ; }
target:  Convert time to a string