Here you can find the source of getDurationBreakdown(long durationInMillis)
Parameter | Description |
---|---|
durationInMillis | A duration to convert to a string form |
public static String getDurationBreakdown(long durationInMillis)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from w w w. j a v a 2s. c om Convert a millisecond duration to a string format @param durationInMillis A duration to convert to a string form @return A string of the form "25:36:259". */ public static String getDurationBreakdown(long durationInMillis) { if (durationInMillis < 0) { throw new IllegalArgumentException("Duration must be greater than zero!"); } return (new SimpleDateFormat("mm:ss:SSS")).format(new Date(durationInMillis)); } }