Here you can find the source of secondsToMinutes(int s)
public static String secondsToMinutes(int s)
//package com.java2s; //License from project: Open Source License public class Main { public static String secondsToMinutes(int s) { int m = s / 60; int ss = s % 60; return align(m) + ":" + align(ss); }//from ww w . java 2 s .c o m private static String align(int i) { String s = String.valueOf(i); if (s.length() == 0) { return "00" + s; } if (s.length() == 1) { return "0" + s; } return s; } }