Java tutorial
//package com.java2s; public class Main { public static String getDuration(String durationInSeconds) { String minutes = String.valueOf(Integer.parseInt(durationInSeconds) / 60); int sec = Integer.parseInt(durationInSeconds) % 60; String seconds = String.valueOf(Integer.parseInt(durationInSeconds) % 60); if (sec < 10) seconds = "0" + seconds; return minutes + ":" + seconds; } }