Here you can find the source of parseTimeString(final String time)
public static long parseTimeString(final String time)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww.j a va 2 s. com * Takes a string of the form [HH:]MM:SS[.mmm] and converts it to * milliseconds. */ public static long parseTimeString(final String time) { String[] parts = time.split(":"); long result = 0; int idx = 0; if (parts.length == 3) { // string has hours result += Integer.valueOf(parts[idx]) * 3600000L; idx++; } result += Integer.valueOf(parts[idx]) * 60000L; idx++; result += (Float.valueOf(parts[idx])) * 1000L; return result; } }