Here you can find the source of parseMills2Time(long elapsedMills)
public static String parseMills2Time(long elapsedMills)
//package com.java2s; public class Main { public static String parseMills2Time(long elapsedMills) { return parseInt2Time(Integer.parseInt(elapsedMills + "")); }// www. ja va 2 s . c o m 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); } }