Java Utililty Methods Time Since Format

List of utility methods to do Time Since Format

Description

The list of methods to do Time Since Format are organized into topic(s).

Method

intdifferenceNumberOfDays(long lodTime, long currentTime)
difference Number Of Days
long cTime = currentTime - lodTime;
Long dTime = cTime / ONE_DAY_MS;
int eTime = dTime.intValue();
return eTime;
longtimeSince()
time Since
return (System.currentTimeMillis() - time) / 1000;
StringtimeSince(long lastTimeInMillis)
time Since
if (lastTimeInMillis == 0) {
    return "Never";
long timeDiff = System.currentTimeMillis() - lastTimeInMillis;
String ret = "";
String sep = "";
if (timeDiff < SECOND_LENGTH) {
    ret = "Less than 1 second";
...
longtimeSince(long t)
Return the number of milliseconds that have elapsed between the specified time and now (as determined by System.currentTimeMillis).
return System.currentTimeMillis() - t;
longtimeSince(long timestart)
Time elapsed since a start time.
return (System.nanoTime() - timestart);
longtimeSinceNanos(long prevTime)
Get the time in nanos passed since a previous time
return nanoTime() - prevTime;
StringtimeSincePretty(long time)
time Since Pretty
return "in " + prettyTime(time, true);