Here you can find the source of getMinutesSeconds(long millisec, String fmt)
public static String getMinutesSeconds(long millisec, String fmt)
//package com.java2s; //License from project: Open Source License public class Main { public static String getMinutesSeconds(long millisec, String fmt) { long minutes = millisec / 1000 / 60; long seconds = (millisec - (minutes * 1000 * 60)) / 1000; if (fmt.isEmpty()) { fmt = "%d:%02d"; }/*ww w.j av a2s . c om*/ return String.format(fmt, minutes, seconds); } }