Java Utililty Methods Millisecond Convert

List of utility methods to do Millisecond Convert

Description

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

Method

StringtoMillisToHHMMSSTime(long timeMillis)
convert to hh:mm:ss
String timeString = "";
timeMillis = timeMillis / 1000;
int days = (int) (timeMillis / 60 / 60 / 24);
if (days > 0) {
    if (days < 10) {
        timeString += "0" + days + "-";
    } else {
        timeString += days + "-";
...
StringtoMillisToKKMMSSTime(long mill)
to Millis To KKMMSS Time
String timeString = "";
mill = mill / 1000;
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;