Here you can find the source of formatTime(final int timeSec)
public static String formatTime(final int timeSec)
//package com.java2s; public class Main { public static String formatTime(final int timeSec) { int s = timeSec; int m = s / 60; s -= (m * 60);/* ww w . j ava 2s . com*/ return String.format("%02d:%02d", m, s); } }