public static int getSeconds(String timeFormat) {
    String[] timeSplit = timeFormat.split(":");
    return (timeSplit.length == 2)
      ? Integer.parseInt(timeSplit[0]) * 60 + Integer.parseInt(timeSplit[1])
      : Integer.parseInt(timeSplit[0]) * 60 * 60
      + Integer.parseInt(timeSplit[1]) * 60
      + Integer.parseInt(timeSplit[2]);
  }
Gets seconds from a string. e.g. 01:00 will return 60 seconds 01:00:00 will return 3600 seconds

@param timeFormat the time format

@return the seconds
KITE-Framework/src/main/java/org/webrtc/kite/Utils.java