Here you can find the source of formatDuring(long mss, String pattern)
public static String formatDuring(long mss, String pattern)
//package com.java2s; //License from project: Apache License import java.text.MessageFormat; public class Main { public static String formatDuring(long mss, String pattern) { long days = mss / (1000 * 60 * 60 * 24); long hours = (mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60); long minutes = (mss % (1000 * 60 * 60)) / (1000 * 60); long seconds = (mss % (1000 * 60)) / 1000; return MessageFormat.format(pattern, days, hours, minutes, seconds); }//from ww w .ja va2 s. co m }