Here you can find the source of secondsToStringFormat(long seconds)
public static String secondsToStringFormat(long seconds)
//package com.java2s; //License from project: Apache License public class Main { public static String secondsToStringFormat(long seconds) { long aux = seconds; int sec = (int) aux % 60; aux = aux / 60;//from w ww.j a va2 s.co m int min = (int) aux % 60; aux = aux / 60; String res; if (sec < 10) res = ":0" + sec; else res = ":" + sec; if (min < 10) res = ":0" + min + res; else res = ":" + min + res; return aux + res; } }