Android Milliseconds to Time Convert parseInt2Time(int millisecond)

Here you can find the source of parseInt2Time(int millisecond)

Description

parse Int Time

Declaration

public static String parseInt2Time(int millisecond) 

Method Source Code

//package com.java2s;

public class Main {

    public static String parseInt2Time(int millisecond) {
        int hour = (int) ((long) millisecond / (60 * 60 * 1000));
        int munit = (int) ((long) (millisecond % (60 * 60 * 1000)) / (60 * 1000));
        int second = (int) ((long) (millisecond % (60 * 1000)) / 1000);
        return (hour == 0 ? "" : hour > 10 ? hour + ":" : "0" + hour + ":")
                + (munit == 0 ? "00:" : munit < 10 ? "0" + munit + ":"
                        : munit + ":")
                + (second == 0 ? "00" : second < 10 ? "0" + second : second);
    }/*from ww w .j av a 2  s . c om*/
}