I want to differentiate between Current Date and Action Date. The difference should be shown as :
3 days ago 4 days ago and son ..
How can I achieve the same in Java using in Android?
It does not work for me and returns the actual date itself:
Date d = Utils.instanceDateFormat().parse(text.toString());
String moments = DateUtils.getRelativeTimeSpanString(d.getTime(), new Date().getTime(), DateUtils.SECOND_IN_MILLIS,
DateUtils.FORMAT_ABBREV_ALL).toString();