I'm using this code to get relative date time in android
long now = System.currentTimeMillis();
long difference = now - this.mReferenceTime;
if ((0 <= difference) && (DateUtils.MINUTE_IN_MILLIS >= difference)) {
return getResources().getString(R.string.just_now);
} else {
return DateUtils.getRelativeTimeSpanString(
this.mReferenceTime,
now,
DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_ABBREV_MONTH | DateUtils.FORMAT_ABBREV_RELATIVE).toString();
}
The output is coming as "28 Mar". How do I make this to "Mar 28"?
This will return strings like "Just now" or "2 minutes ago" or "6 days ago" or something like "28 Mar". I just wanna change the "28 Mar" part to "Mar 28".