|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javalite.common.HumanDate
public final class HumanDate
This is a helper class for converting distance bewteen two dates to a human format, like: "two days", "three months", etc.
It was inspired by a Rails helper method: distance_of_time_in_words
| Method Summary | |
|---|---|
static String |
toHumanFormat(long fromTime)
This is a convenience method in addition to toHumanFormat(long, long), except the second parameter is
always now. |
static String |
toHumanFormat(long fromTime,
long toTime)
Generates a human representation of distance in time between two time stamps. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String toHumanFormat(long fromTime,
long toTime)
fromTime - start timestamp. This is a representation of time in milliseconds from January 1 1970.toTime - end timestamp. This is a representation of time in milliseconds from January 1 1970.
fromTime and toTime.public static String toHumanFormat(long fromTime)
toHumanFormat(long, long), except the second parameter is
always now.
fromTime - start date. This is a representation of time in milliseconds from January 1 1970.
fromTime and now.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||