Here you can find the source of timeToSeconds(String targetTime)
public static int timeToSeconds(String targetTime)
//package com.java2s; //License from project: Apache License public class Main { public static int timeToSeconds(String targetTime) { int s = 0; s += (Integer.parseInt(targetTime.split(":")[0]) * 60 * 60); s += (Integer.parseInt(targetTime.split(":")[1]) * 60); s += Integer.parseInt(targetTime.split(":")[2]); return s; }//w ww. ja v a2s .c o m }