public class TimeFormatter
extends java.lang.Object
| Constructor and Description |
|---|
TimeFormatter() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
format(java.lang.String format,
long time)
Format a time in milliseconds to a string.
|
static java.lang.String |
format(java.lang.String format,
long time,
boolean utc)
Format a time in milliseconds to a (UTC) string.
|
static java.lang.String |
formatHHMMSS(long time)
Format a time in milliseconds to a string in the format "HH:mm:ss".
|
static java.lang.String |
formatMMSS(long time)
Format a time in milliseconds to a string in the format "mm:ss".
|
public static java.lang.String format(java.lang.String format,
long time)
SimpleDateFormat for the format string.format - The format stringtime - The time in millisecondspublic static java.lang.String format(java.lang.String format,
long time,
boolean utc)
SimpleDateFormat for the format string.format - The format stringtime - The time in millisecondsutc - If the time should be formatted in UTCpublic static java.lang.String formatMMSS(long time)
123000 -> 02:03time - The time in millisecondspublic static java.lang.String formatHHMMSS(long time)
3723000 -> 01:02:03time - The time in milliseconds