Here you can find the source of stringForTime(long timeMs)
public static String stringForTime(long timeMs)
//package com.java2s; public class Main { public static String stringForTime(long timeMs) { long totalSeconds = timeMs / 1000; long seconds = totalSeconds % 60; long minutes = (totalSeconds / 60) % 60; long hours = totalSeconds / 3600; return String.format("%02d:%02d:%02d", hours, minutes, seconds); }//from w ww .ja va 2s .c o m }