Java Second stringToSeconds(String string)

Here you can find the source of stringToSeconds(String string)

Description

string To Seconds

License

Open Source License

Declaration

public static long stringToSeconds(String string) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static long stringToSeconds(String string) {
        long seconds = 0;
        String[] values = string.split(":");
        seconds = Long.parseLong(values[0]) * 3600
                + Long.parseLong(values[1]) * 60
                + Long.parseLong(values[2]);

        return seconds;
    }/*from   w w  w . j a  va2s.co m*/
}

Related

  1. secondsAfterMidnightToClock(int secondsAfterMidnight)
  2. secondsAgo(int seconds)
  3. secondsFromBeginningOfBoardcastEpoch()
  4. secondsSince(final long since)
  5. secondToString(long second)
  6. strTimeToSeconds(String hmsTimes)
  7. ticksToSeconds(long ticks)
  8. ticksWithSecondsSetTo(long ticks, int seconds)
  9. timecents2seconds(int timecents)