Created
September 25, 2015 20:09
-
-
Save msomu/f98b68b469c82f52de1d to your computer and use it in GitHub Desktop.
A small time util to convert TimeStamp into momments ago
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void setTime(String time) { | |
| if (!TextUtils.isEmpty(time)) { | |
| CharSequence relativeTimeSpanString = DateUtils.getRelativeTimeSpanString(Long.valueOf(time), System.currentTimeMillis(), DateUtils.SECOND_IN_MILLIS, DateUtils.FORMAT_ABBREV_RELATIVE); | |
| this.time = relativeTimeSpanString.toString(); | |
| } else { | |
| this.time = ""; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment