public class TimeUtils
extends java.lang.Object
| Constructor and Description |
|---|
TimeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
fancyTimestamp(long epoch)
Generate a fancy timestamp based on unix epoch time that is more user friendly than just
a raw output by collapsing the time into manageable formats based on how much time has
elapsed since epoch
|
static java.lang.String |
formatHumanFriendlyShortDate(android.content.Context context,
long timestamp)
Returns "Today", "Tomorrow", "Yesterday", or a short date format.
|
static java.lang.String |
formatShortDate(android.content.Context context,
java.util.Date date) |
static java.lang.String |
getTimeAgo(long time)
Get a timestamp in a an *ago format
e.g.; "just now", "a minute ago", "5 minutes ago", "10 hours ago", "2 days ago", etc...
|
public static java.lang.String getTimeAgo(long time)
Get a timestamp in a an *ago format e.g.; "just now", "a minute ago", "5 minutes ago", "10 hours ago", "2 days ago", etc...
time - the time to formatpublic static java.lang.String fancyTimestamp(long epoch)
epoch - the time in unix epochpublic static java.lang.String formatHumanFriendlyShortDate(android.content.Context context,
long timestamp)
public static java.lang.String formatShortDate(android.content.Context context,
java.util.Date date)