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