Here you can find the source of duration(int len)
public static String duration(int len)
//package com.java2s; //License from project: Open Source License public class Main { public static String duration(int len) { final int hours = len / 3600; final int minutes = len / 60 % 60; final int seconds = len % 60; return String.format("%02d:%02d:%02d", hours, minutes, seconds); }//from w ww .j av a 2s . c om }