Here you can find the source of stringToSeconds(String string)
public static long stringToSeconds(String string)
//package com.java2s; //License from project: Open Source License public class Main { public static long stringToSeconds(String string) { long seconds = 0; String[] values = string.split(":"); seconds = Long.parseLong(values[0]) * 3600 + Long.parseLong(values[1]) * 60 + Long.parseLong(values[2]); return seconds; }/*from w w w . j a va2s.co m*/ }