Here you can find the source of formatTime(int secs)
public static String formatTime(int secs)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatTime(int secs) { String minutes = String.valueOf(secs / 60); String seconds = String.valueOf(secs % 60); if (secs % 60 < 10) { seconds = "0" + seconds; }/*ww w .j a va 2 s. co m*/ if (secs % 60 == 0) { seconds = "00"; } return minutes + ":" + seconds; } }