Java Second Get getSecondTime(String time)

Here you can find the source of getSecondTime(String time)

Description

get Second Time

License

Apache License

Declaration

public static long getSecondTime(String time) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static long getSecondTime(String time) {
        long rt = 0;
        if (time != null) {
            String[] times = time.split(":");
            if (times.length == 3) {
                rt = Long.parseLong(times[0]) * 3600
                        + Long.parseLong(times[1]) * 60
                        + Long.parseLong(times[2]);
            }//from   w w w  .  j  a  va 2  s  . c om
        }
        return rt;
    }
}

Related

  1. getSecondsInDDHHMMSS(int s)
  2. getSecondsText(long seconds)
  3. getSecondsToHHMMSS(double seconds)
  4. getSecondsToMMSS(double seconds)
  5. getSecondTime()
  6. getSecondToLastIndexOf(String string, char character)
  7. getSecondVersion(String buildId)
  8. getSYNTimeSeconds()
  9. getTextBeforeFirstAndSecondColumns(String s)