How to transform date
to CharSequence
. I used to convert date to string.
But I get an Exception
.
CharSequence timeAgo = DateUtils.getRelativeTimeSpanString(
Long.parseLong(newsData.getNewsDateCreated()),
System.currentTimeMillis(), DateUtils.SECOND_IN_MILLIS);
How do I convert it correctly? My remote server return a date format: 2016-9-26
- I don't want this to appear. From date I need to convert it to time maybe?
The output should give me like this: