Java tutorial
//package com.java2s; public class Main { /** * convert to number of seconds * * @param time * @return */ public static long timeInSeconds(String time) { String[] tempTime = time.split(":"); int mins = Integer.parseInt(tempTime[0]); int sec = Integer.parseInt(tempTime[1]); return mins * 60 + sec; } }