Java Second strTimeToSeconds(String hmsTimes)

Here you can find the source of strTimeToSeconds(String hmsTimes)

Description

str Time To Seconds

License

Open Source License

Declaration

public static int strTimeToSeconds(String hmsTimes) 

Method Source Code

//package com.java2s;

public class Main {
    public static int strTimeToSeconds(String hmsTimes) {
        int seconds = 0;
        String[] arrHMS = hmsTimes.split(":");
        int h = Integer.parseInt(arrHMS[0]);
        int m = Integer.parseInt(arrHMS[1]);
        int s = Integer.parseInt(arrHMS[2]);
        seconds = h * 3600 + m * 60 + s;
        return seconds;
    }/*from   ww  w . j av a  2  s.co m*/
}

Related

  1. secondsAgo(int seconds)
  2. secondsFromBeginningOfBoardcastEpoch()
  3. secondsSince(final long since)
  4. secondToString(long second)
  5. stringToSeconds(String string)
  6. ticksToSeconds(long ticks)
  7. ticksWithSecondsSetTo(long ticks, int seconds)
  8. timecents2seconds(int timecents)
  9. timeDecimalSeconds(String time)