Here you can find the source of millsecondsToMinutesAndSeconds(long milliseconds)
public static String millsecondsToMinutesAndSeconds(long milliseconds)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may public class Main { private final static long MINUTE = 60; public static String millsecondsToMinutesAndSeconds(long milliseconds) { String result = milliseconds > 0 ? "" : "0:00"; long totalSeconds = milliseconds / 1000; long minutes = totalSeconds / MINUTE; long seconds = (totalSeconds % MINUTE); result += minutes;/*from www .j a v a2s.co m*/ result += ":"; if (seconds < 10) result += "0"; result += seconds; return result; } }