Here you can find the source of formatMillisIntoMinutesAndSeconds(long millis)
public static String formatMillisIntoMinutesAndSeconds(long millis)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; public class Main { public static String formatMillisIntoMinutesAndSeconds(long millis) { return String.format("%d min, %d sec", TimeUnit.MILLISECONDS.toMinutes(millis), TimeUnit.MILLISECONDS.toSeconds(millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))); }//from w w w .ja v a 2 s .c o m }