public static long getDifference ( Time timeFrom , Time timeTo ) { try { DateFormat format = new SimpleDateFormat ( "HH:mm:ss" ) ; // the a means am/pm marker Date date = format . parse ( timeFrom . toString ( ) ) ; Date date2 = format . parse ( timeTo . toString ( ) ) ; long difference = ( date2 . getTime ( ) - date . getTime ( ) ) / 1000 / 60 ; return difference ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Gets the difference .