我在这里问一个简单的问题,但请放轻松。
好的......我有TextView
显示我的笔记创建日期 - 工作正常,但如何将时间戳转换为" 7分钟前",&# 34;昨天"," 3周前"," 2个月前"等
// joda-time
final String timeFormat = "HH:mm"; ///'o''clock'
final String dateFormat = "EEE, MMM.DD YYYY"; ///EEE MMM dd yyyy
final DateTime createTime = note.getCreateTime();
final String createdString = createTime.toLocalDate().toString(dateFormat) + " " + createTime.toLocalTime().toString(timeFormat);
String timestamp = StringUtils.wrapWithEmptyLines(getString(R.string.note_list_timestamp_info_created,createdString));
final TextView textTS = (TextView) view.findViewById(R.id.timestamp);
textTS.setText(timestamp);