Java tutorial
//package com.java2s; import java.util.concurrent.TimeUnit; public class Main { public static String milisecondsToMinuteString(long miliseconds) { return String.format("%d:%02d", TimeUnit.MILLISECONDS.toMinutes(miliseconds), TimeUnit.MILLISECONDS.toSeconds(miliseconds) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(miliseconds))); } }