Java Millisecond Convert toMillisToKKMMSSTime(long mill)

Here you can find the source of toMillisToKKMMSSTime(long mill)

Description

to Millis To KKMMSS Time

License

Apache License

Declaration

public static String toMillisToKKMMSSTime(long mill) 

Method Source Code

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

public class Main {

    public static String toMillisToKKMMSSTime(long mill) {
        String timeString = "";
        mill = mill / 1000;//from   www  .j av  a  2  s.  c  om
        int hours = (int) (mill / 60 / 60);
        if (hours < 10) {
            timeString += "0" + hours + ":";
        } else {
            timeString += hours + ":";
        }
        int minutes = (int) ((mill - hours * 60 * 60) / 60);
        if (minutes < 10) {
            timeString += "0" + minutes + ":";
        } else {
            timeString += minutes + ":";
        }
        int seconds = (int) (mill % 60);
        if (seconds < 10) {
            timeString += "0" + seconds;
        } else {
            timeString += seconds;
        }
        return timeString;
    }
}

Related

  1. toMilliseconds(Object value)
  2. toMillisFromNanos(long nanos)
  3. toMillisInfo(long ms)
  4. toMillisToDayTime(long mill)
  5. toMillisToHHMMSSTime(long timeMillis)