public class PeriodFormatterUtil extends Object
| Constructor and Description |
|---|
PeriodFormatterUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.joda.time.Period |
createDayHourMinSecPeriod(long durationInMillis)
Creates a new Period that can be used properly with the "Uptime" styles
returned by this utility class.
|
static org.joda.time.PeriodType |
getDayHourMinSecPeriodType()
Gets a PeriodType that can be used to create a Period that is normalized
to only include the fields Day, Hour, Minute, and Second.
|
static org.joda.time.format.PeriodFormatter |
getLinuxUptimeStyle()
Gets a PeriodFormatter in the Linux OS style such as "0 days, 01:05:12"
or "2 days, 07:00:00".
|
static org.joda.time.format.PeriodFormatter |
getStandardUptimeStyle()
Gets a PeriodFormatter in the standard Uptime style such as "0 days 0 hours 1 min 50 secs"
or "2 days 7 hours 1 min 50 secs".
|
static String |
toLinuxUptimeStyleString(long durationInMillis)
Helper method to create a "Linux" uptime styled string that represents
the duration (in milliseconds).
|
static String |
toStandardUptimeStyleString(long durationInMillis)
Helper method to create a "Standard" uptime styled string that represents
the duration (in milliseconds).
|
public static org.joda.time.PeriodType getDayHourMinSecPeriodType()
createDayHourMinSecPeriod(long)public static org.joda.time.Period createDayHourMinSecPeriod(long durationInMillis)
durationInMillis - The length of the duration in millisecondspublic static org.joda.time.format.PeriodFormatter getLinuxUptimeStyle()
createDayHourMinSecPeriod(long)public static org.joda.time.format.PeriodFormatter getStandardUptimeStyle()
createDayHourMinSecPeriod(long)public static String toLinuxUptimeStyleString(long durationInMillis)
durationInMillis - The duration (in millis)public static String toStandardUptimeStyleString(long durationInMillis)
durationInMillis - The duration (in millis)Copyright © 2012-2015 Cloudhopper by Twitter. All Rights Reserved.