Java tutorial
//package com.java2s; public class Main { public static int getDuration(String duration) { int durations = 0; try { String sArray[] = duration.split(":"); int hour = Integer.valueOf(sArray[0]); int minute = Integer.valueOf(sArray[1]); int second = Integer.valueOf(sArray[2]); return ((hour * 60 + minute) * 60 + second) * 1000; } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } return durations; } }