Here you can find the source of getSecondsAsClock(int time)
public static String getSecondsAsClock(int time)
//package com.java2s; public class Main { public static final int HOUR = 72000; public static final int MINUTE = 1200; public static final int SECOND = 20; public static String getSecondsAsClock(int time) { int hour = time * 20 / HOUR; int minute = (time * 20 - hour * HOUR) / MINUTE; int second = (time * 20 - hour * HOUR - minute * MINUTE) / SECOND; return String.format("%02d:%02d:%02d", hour, minute, second); }/* w w w . ja va2s . c o m*/ }