Android examples for java.util:Date Time
Format Time duration in format 00:00
public class Main { public static String getFormatTime(int duration) { int min = 0;// w ww. j a va 2 s . c om int sec; sec = duration / 1000; if (sec > 60) { min = sec / 60; sec = sec % 60; } return String.format("%02d:%02d", min, sec); } }