Here you can find the source of formatDurationMillisToString(long millis)
public static String formatDurationMillisToString(long millis)
//package com.java2s; //License from project: Open Source License import java.sql.Date; import java.text.SimpleDateFormat; public class Main { public static final String DURATION_PATTERN = "HH:mm:ss.SSS"; private static final SimpleDateFormat FORMAT = new SimpleDateFormat(DURATION_PATTERN); public static String formatDurationMillisToString(long millis) { return formatMillisToString(millis, DURATION_PATTERN); }/*w ww .j a v a 2 s . c o m*/ public static String formatMillisToString(long millis, String pattern) { Date date = new Date(millis); FORMAT.applyPattern(pattern); return FORMAT.format(date); } }