Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;

    }
}