Java Utililty Methods Second Get

List of utility methods to do Second Get

Description

The list of methods to do Second Get are organized into topic(s).

Method

StringgetSecondsText(long seconds)
get Seconds Text
if (seconds == 0)
    return (" seconds");
return ((seconds > 1 ? " seconds" : " second"));
StringgetSecondsToHHMMSS(double seconds)
get Seconds To HHMMSS
long seg = Math.round(seconds);
long hh = seg / 3600;
seg = seg % 3600;
long mm = seg / 60;
seg = seg % 60;
return (hh < 10 ? "0" : "") + hh + ":" + (mm < 10 ? "0" : "") + mm + ":" + (seg < 10 ? "0" : "") + seg;
StringgetSecondsToMMSS(double seconds)
get Seconds To MMSS
long seg = (int) Math.round(seconds);
if (seg >= 3600)
    return getSecondsToHHMMSS(seconds);
long mm = seg / 60;
seg = seg % 60;
return (mm < 10 ? "0" : "") + mm + ":" + (seg < 10 ? "0" : "") + seg;
StringgetSecondTime()
get Second Time
return String.valueOf(System.currentTimeMillis()).substring(0, 10);
longgetSecondTime(String time)
get Second 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]);
return rt;
...
intgetSecondToLastIndexOf(String string, char character)
get Second To Last Index Of
String temp = string.substring(0, string.lastIndexOf(character));
return temp.lastIndexOf(character);
StringgetSecondVersion(String buildId)
get Second Version
String[] items = buildId.split("\\.");
return items[1];
doublegetSYNTimeSeconds()
get the SYN time in seconds.
return 0.01;
StringgetTextBeforeFirstAndSecondColumns(String s)
get Text Before First And Second Columns
if (null == s)
    return NULL_STRING;
int i1 = s.indexOf(58); 
if (-1 == i1)
    return s;
int i2 = s.indexOf(58, i1 + 1);
if (-1 == i2)
    return s.substring(i1 + 1);
...
longgetTimeAsSeconds(String value)
A time can be passed in as a long in millis, or with a unit on it, like '60s'.
return getTimeAsMillis(value) / 1000;