public class DurationUtils extends Object
Constructor and Description |
---|
DurationUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
parse(String durationString)
Parses a human readable duration string and calculates the number of seconds it represents.
|
static String |
toString(int durationSeconds)
Create a human readable duration string from seconds.
|
static String |
toString(int durationSeconds,
boolean includeMonths)
Create a human readable duration string from seconds.
|
public static final String toString(int durationSeconds)
durationSeconds
- the total number of seconds in the durationpublic static final String toString(int durationSeconds, boolean includeMonths)
durationSeconds
- the total number of seconds in the durationincludeMonths
- when true will include months "mo", in the string otherwise
uses "4w" for each monthpublic static final int parse(String durationString)
durationString
- the human readable durationCopyright © 2019. All rights reserved.