Here you can find the source of printTime(long millis)
public static String printTime(long millis)
//package com.java2s; //License from project: Open Source License public class Main { public static String printTime(long millis) { long second = (millis / 1000) % 60; long minute = (millis / (1000 * 60)) % 60; long hour = (millis / (1000 * 60 * 60)) % 24; String time = String.format("%02d:%02d:%02d:%d", hour, minute, second, millis); return time; }//from ww w.j ava 2 s. co m }