Here you can find the source of convertSecondsToTime(int totalSecs)
public static String convertSecondsToTime(int totalSecs)
//package com.java2s; //License from project: Apache License public class Main { public static String convertSecondsToTime(int totalSecs) { int hours = totalSecs / 3600; int minutes = (totalSecs % 3600) / 60; int seconds = totalSecs % 60; return (hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds; }/*from w w w . ja v a2 s .co m*/ }