String toAbsoluteFormat ( long time ) { calendar . setTime ( new Date ( time ) ) ; long hours = calendar . get ( Calendar . HOUR_OF_DAY ) ; StringBuffer buffer = new StringBuffer ( ) ; if ( hours < 10 ) { buffer . append ( ' ' ) ; } buffer . append ( hours ) ; buffer . append ( ' ' ) ; long minutes = calendar . get ( Calendar . MINUTE ) ; if ( minutes < 10 ) { buffer . append ( ' ' ) ; } buffer . append ( minutes ) ; buffer . append ( ' ' ) ; long seconds = calendar . get ( Calendar . SECOND ) ; if ( seconds < 10 ) { buffer . append ( ' ' ) ; } buffer . append ( seconds ) ; buffer . append ( ' ' ) ; long milliseconds = calendar . get ( Calendar . MILLISECOND ) ; if ( milliseconds < 10 ) { buffer . append ( ' ' ) ; } buffer . append ( milliseconds ) ; return buffer . toString ( ) ; }
Format as an absolute date time format that is