Here you can find the source of formatTime(long millis)
public static String formatTime(long millis)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatTime(long millis) { if (millis == Long.MAX_VALUE) { return "LIVE"; }/*www .j a v a 2 s . c o m*/ long t = millis / 1000L; int sec = (int) (t % 60L); int min = (int) ((t % 3600L) / 60L); int hrs = (int) (t / 3600L); String timestamp; if (hrs != 0) { timestamp = forceTwoDigits(hrs) + ":" + forceTwoDigits(min) + ":" + forceTwoDigits(sec); } else { timestamp = forceTwoDigits(min) + ":" + forceTwoDigits(sec); } return timestamp; } private static String forceTwoDigits(int i) { return i < 10 ? "0" + i : Integer.toString(i); } }