Viv*_*sse 41
我想你正在谈论getRelativeDateTimeString,你的链接指向.
示例now,其中包含详细说明所有参数的注释:
Date now = new Date();
String str = DateUtils.getRelativeDateTimeString(
this, // Suppose you are in an activity or other Context subclass
now.getTime(), // The time to display
DateUtils.MINUTE_IN_MILLIS, // The resolution. This will display only
// minutes (no "3 seconds ago")
DateUtils.WEEK_IN_MILLIS, // The maximum resolution at which the time will switch
// to default date instead of spans. This will not
// display "3 weeks ago" but a full date instead
0); // Eventual flags
Run Code Online (Sandbox Code Playgroud)
对于其他值MINUTE_IN_MILLIS和YEAR_IN_MILLIS包括:
SECOND_IN_MILLISMINUTE_IN_MILLISHOUR_IN_MILLISDAY_IN_MILLISWEEK_IN_MILLISYEAR_IN_MILLIS| 归档时间: |
|
| 查看次数: |
13804 次 |
| 最近记录: |