Package org.eclipse.jgit.util
Class RelativeDateFormatter
java.lang.Object
org.eclipse.jgit.util.RelativeDateFormatter
Formatter to format timestamps relative to the current time using time units
in the format defined by
git log --relative-date
.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final long
(package private) static final long
(package private) static final long
(package private) static final long
(package private) static final long
(package private) static final long
(package private) static final long
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
SECOND_IN_MILLIS
static final long SECOND_IN_MILLIS- See Also:
-
MINUTE_IN_MILLIS
static final long MINUTE_IN_MILLIS- See Also:
-
HOUR_IN_MILLIS
static final long HOUR_IN_MILLIS- See Also:
-
DAY_IN_MILLIS
static final long DAY_IN_MILLIS- See Also:
-
WEEK_IN_MILLIS
static final long WEEK_IN_MILLIS- See Also:
-
MONTH_IN_MILLIS
static final long MONTH_IN_MILLIS- See Also:
-
YEAR_IN_MILLIS
static final long YEAR_IN_MILLIS- See Also:
-
-
Constructor Details
-
RelativeDateFormatter
public RelativeDateFormatter()
-
-
Method Details
-
format
Get age of givenDate
compared to now formatted in the same relative format as returned bygit log --relative-date
-
upperLimit
private static long upperLimit(long unit) -
round
private static long round(long n, long unit)
-