Here you can find the source of getTimeString(long millis)
public static String getTimeString(long millis)
//package com.java2s; //License from project: Apache License public class Main { public static String getTimeString(long millis) { StringBuffer buffer = new StringBuffer(); int minutes = (int) ((millis % (1000 * 60 * 60)) / (1000 * 60)); int seconds = (int) (((millis % (1000 * 60 * 60)) % (1000 * 60)) / 1000); buffer.append(String.format("%02d", minutes)).append(":") .append(String.format("%02d", seconds)); return buffer.toString(); }//from w w w .j a va 2 s . c om }