KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
using the built in getRelativeTimeSpanString() method in android DateUtil I am unable to get the "minutes ago" "days ago" etc. time elapsed response that the documentation says that I should receive, instead I get a result that just displays the actual date in a way such as "may 12 2010", not sure if this is a bug or what but Ive tried both getRelativeTimeSpanString (long time, long now, long minResolution) and getRelativeTimeSpanString (long startTime) , both just return the actual date of the variable "long time" here is my code private void setJoineddate() { Date currentDate = new Date(); long currentDateLong = currentDate.getTime(); long oldDate = join_date.getTime(); CharSequence relativeTime = DateUtils .getRelativeTimeSpanString(oldDate, currentDateLong, 0); joindate.setText(relativeTime); }
Tags (comma-separated)
Save Edits
Cancel