Here you can find the source of formatTime(int time)
public static String formatTime(int time)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatTime(int time) { //seconds ROUND UP! int seconds = (int) Math.ceil((time % 6000) / 100.0); int minutes = time / 6000; if (seconds == 60) { seconds = 0;/*from w w w. jav a 2 s .co m*/ minutes++; } return String.format("%02d:%02d", minutes, seconds); } }