Here you can find the source of getSecondTime(String time)
public static long getSecondTime(String time)
//package com.java2s; //License from project: Apache License public class Main { public static long getSecondTime(String time) { long rt = 0; if (time != null) { String[] times = time.split(":"); if (times.length == 3) { rt = Long.parseLong(times[0]) * 3600 + Long.parseLong(times[1]) * 60 + Long.parseLong(times[2]); }//from w w w . j a va 2 s . c om } return rt; } }