public class DurationUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AGO |
static String |
PRIOR_TEXT |
Modifier and Type | Method and Description |
---|---|
static long |
getElapsedTime(Date fromDate) |
static long |
getElapsedTime(long fromDate) |
static DurationUtils |
getInstance() |
static long |
getNormalizedTime(long elapsedTimeMillis)
Converts time in milliseconds to the number of milliseconds that fill in the nearest hour, minute or second.
|
static String |
getPrettyPrint(long elapsedTimeMillis) |
static String |
getPrettyPrint(long elapsedTimeMillis,
boolean isLong) |
static String |
getPrettyPrint(long elapsedTimeMillis,
PrettyLength prettyLength)
Formats time to the nearest hour, minute or second.
|
static String |
getRelativeDate(Date fromDate) |
static String |
getRelativeDate(Date fromDate,
Date comparedTo) |
static String |
getRelativeDate(long fromDate) |
static String |
getRelativeToDate(long fromDate) |
public static final String PRIOR_TEXT
public static final String AGO
public static DurationUtils getInstance()
public static String getPrettyPrint(long elapsedTimeMillis, PrettyLength prettyLength)
Note - Currently ignore hours (display them in minutes) see BJ-119
elapsedTimeMillis
- The timeprettyLength
- determines whether you want the long, medium or short string representation, e.g minute vs min vs mpublic static String getPrettyPrint(long elapsedTimeMillis)
public static String getPrettyPrint(long elapsedTimeMillis, boolean isLong)
public static long getNormalizedTime(long elapsedTimeMillis)
elapsedTimeMillis
- public static long getElapsedTime(Date fromDate)
public static long getElapsedTime(long fromDate)
public static String getRelativeDate(long fromDate)
public static String getRelativeToDate(long fromDate)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.