Here you can find the source of formatTime(int time)
public static String formatTime(int time)
//package com.java2s; //License from project: LGPL public class Main { public static String formatTime(int time) { int seconds = time % 60; time /= 60;/*from w ww . j a va2 s . c om*/ int minutes = time % 60; time /= 60; int hours = time % 24; time /= 24; int days = time; return String.format("%d:%02d:%02d:%02d", days, hours, minutes, seconds); } }