public static long getSecondsDifference ( Date startDate , Date endDate ) { long startTime = startDate . getTime ( ) ; long endTime = endDate . getTime ( ) ; long diffTime = endTime - startTime ; long diffInSeconds = TimeUnit . MILLISECONDS . toSeconds ( diffTime ) ; return diffInSeconds ; }
Gets the seconds difference .