public final class RelativeDateTimeFormatter extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DAY_IN_MILLIS |
static long |
HOUR_IN_MILLIS |
static long |
MINUTE_IN_MILLIS |
static long |
SECOND_IN_MILLIS |
static long |
WEEK_IN_MILLIS |
static long |
YEAR_IN_MILLIS |
| Modifier and Type | Method and Description |
|---|---|
static String |
getRelativeDateTimeString(Locale locale,
TimeZone tz,
long time,
long now,
long minResolution,
long transitionResolution,
int flags)
This is the internal API that implements
DateUtils.getRelativeDateTimeString(long, long, long, long, int), which is
to return a string describing 'time' as a time relative to 'now', formatted
like '[relative time/date], [time]'.
|
static String |
getRelativeTimeSpanString(Locale locale,
TimeZone tz,
long time,
long now,
long minResolution,
int flags)
This is the internal API that implements the functionality of
DateUtils.getRelativeTimeSpanString(long, long, long, int), which is to
return a string describing 'time' as a time relative to 'now' such as
'5 minutes ago', or 'In 2 days'.
|
static String |
getRelativeTimeSpanString(Locale locale,
TimeZone tz,
long time,
long now,
long minResolution,
int flags,
DisplayContext displayContext) |
public static final long SECOND_IN_MILLIS
public static final long MINUTE_IN_MILLIS
public static final long HOUR_IN_MILLIS
public static final long DAY_IN_MILLIS
public static final long WEEK_IN_MILLIS
public static final long YEAR_IN_MILLIS
public static String getRelativeTimeSpanString(Locale locale, TimeZone tz, long time, long now, long minResolution, int flags)
public static String getRelativeTimeSpanString(Locale locale, TimeZone tz, long time, long now, long minResolution, int flags, DisplayContext displayContext)
public static String getRelativeDateTimeString(Locale locale, TimeZone tz, long time, long now, long minResolution, long transitionResolution, int flags)