Here you can find the source of format(String format, long time)
public static String format(String format, long time)
//package com.java2s; //License from project: Open Source License public class Main { public static String format(String format, long time) { long seconds = (time / 1000) % 60; long minutes = (time / (1000 * 60)) % 60; long hours = (time / (1000 * 60 * 60)) % 24; return String.format(format, hours, minutes, seconds); }// ww w . java 2s .c om }