Java tutorial
//package com.java2s; public class Main { static String formatTime(float seconds) { int hh = (int) Math.floor(seconds / 3600); seconds = seconds - hh * 3600; int mm = (int) Math.floor(seconds / 60); seconds = seconds - mm * 60; int ss = (int) Math.floor(seconds); return String.format("%d:%02d:%02d", hh, mm, ss); } }