Question: how to find time difference between two timestamps in java?
Answer: String a = timeSt. get(0); // timeSt is an ArrayList which includes all the timeStamps String b = timeSt. get(timeSt. size()-1); // This method aims finding the difference of the first and the last elements(timestamps) of the ArrayList (in seconds) long i = Long.