Here you can find the source of timeToSeconds(String time)
public static long timeToSeconds(String time)
//package com.java2s; public class Main { public static long timeToSeconds(String time) { String[] strs = time.split(":"); long seconds = Long.valueOf(strs[0]) * 60 * 60 * 1000 + Long.valueOf(strs[1]) * 60 * 1000 + Long.valueOf(strs[2]) * 1000;// w w w . j ava 2 s.com return seconds; } }