androidtimestampandroid-dateutils

converting timestamp to relative time in android


Timestamp which I use is in the format "YYYY-MM-DD HH:MM:SS" now I want it to convert it into corresponding relative time . Have searched a lot on this topic . I know DateUtils can be used to do this , but I cannot find any method in DateUtils that uses Timestamp as a parameter.


Solution

  • Check out the SimpleDateFormat class: http://developer.android.com/reference/java/text/SimpleDateFormat.html