Java Second Get timeToSeconds(String targetTime)

Here you can find the source of timeToSeconds(String targetTime)

Description

time To Seconds

License

Apache License

Declaration

public static int timeToSeconds(String targetTime) 

Method Source Code

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

public class Main {
    public static int timeToSeconds(String targetTime) {
        int s = 0;
        s += (Integer.parseInt(targetTime.split(":")[0]) * 60 * 60);
        s += (Integer.parseInt(targetTime.split(":")[1]) * 60);
        s += Integer.parseInt(targetTime.split(":")[2]);
        return s;
    }//w ww. ja v a2s .c  o m
}

Related

  1. getTokenRenewIntervalInSeconds(int tokenValidityInSeconds)
  2. getUnitLengthSeconds(String unit)
  3. getUnixTimeSeconds()
  4. getUSeconds(int time)
  5. getValidCodeSecond()