[Solved] Android : how can I add 5 Times in a variable and get total seconds of them

A easy way to do it, if the format is the one you have pointed, without have to worry in convert the Date is the following: int totalSum = getSecondsFromDate(“05:12:02”) + getSecondsFromDate(“19:12:52”) + getSecondsFromDate(“40:12:14”) + getSecondsFromDate(“56:54:10”) + getSecondsFromDate(“41:12:12”); private int getSecondsFromDate(String date){ //We split the date to have hours, minutes and seconds String splitDate = … Read more