Java Utililty Methods Second

List of utility methods to do Second

Description

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

Method

StringtrimMiliSeconds(String time)
trim Mili Seconds
if (time.matches("[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\.[0-9]")
        || time.matches(
                "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\.[0-9][0-9]")
        || time.matches(
                "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\.[0-9][0-9][0-9]")) {
    int index = time.indexOf('.');
    return time.substring(0, index);
return time;
voidvalidateSecond(int second)
validate Second
if (second < 0 || second > 59) {
    throw new IllegalArgumentException("Invalid second (must be >= 0 and <= 59).");
StringvalueOfSecond(long time)
value Of Second
long h = time / 3600;
long m = (time % 3600) / 60;
long s = (time % 3600) % 60;
String value = h + "Basic_hour" + ":" + m + "Basic_min" + ":" + s + "Basic_sec";
return value;