Here you can find the source of time2LongMillis(String timestr)
public static long time2LongMillis(String timestr)
//package com.java2s; public class Main { public static long time2LongMillis(String timestr) { String[] times = timestr.split(":"); if (times.length == 1) { return Long.parseLong(times[0]) * 1000; } else if (times.length == 2) { return (Long.parseLong(times[0]) * 60 + Long .parseLong(times[1])) * 1000; } else if (times.length == 3) { return (Long.parseLong(times[0]) * 3600 + Long.parseLong(times[1]) * 60 + Long .parseLong(times[2])) * 100; } else {/* w w w. ja v a 2 s .c o m*/ return 0; } } }