Here you can find the source of secondsToTimeClock(int totalSeconds)
public static String secondsToTimeClock(int totalSeconds)
//package com.java2s; //License from project: Open Source License public class Main { public static String secondsToTimeClock(int totalSeconds) { double totalSecondsDouble = (int) totalSeconds; int minutes = (int) (Math.floor(totalSecondsDouble / 60)); int seconds = (int) (totalSecondsDouble % 60); return "" + (minutes > 0 ? minutes : "0") + ":" + (seconds < 1 ? "00" : (seconds < 10 ? "0" : "") + seconds); }/*ww w.jav a2s . co m*/ }