public static String toClock ( long time ) { long ttime = time ; short miliseconds = ( short ) ( ttime % 1000 ) ; ttime = ttime / 1000 ; short seconds = ( short ) ( ttime % 60 ) ; ttime = ttime / 60 ; short minutes = ( short ) ( ttime % 60 ) ; ttime = ttime / 60 ; short hours = ( short ) ( ttime % 24 ) ; ttime = ttime / 24 ; short days = ( short ) ( ttime % 7 ) ; short weeks = ( short ) ( ttime / 7 ) ; StringBuilder s = new StringBuilder ( ) ; s . append ( ( ( weeks * 7 + days ) * 24 + hours ) + ":" ) ; if ( minutes < 10 ) { s . append ( ' ' ) ; } s . append ( minutes + ":" ) ; if ( seconds < 10 ) { s . append ( ' ' ) ; } s . append ( seconds + "." ) ; if ( miliseconds < 100 ) { s . append ( ' ' ) ; } if ( miliseconds < 10 ) { s . append ( ' ' ) ; } s . append ( miliseconds ) ; return s . toString ( ) ; }
Transforms a millisecond value to the clock representation .