Java tutorial
import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public abstract class TimeUtils { public static String formatDuration(long duration) { SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss:SSS"); format.setTimeZone(TimeZone.getTimeZone("GMT")); return format.format(new Date(duration)); } }