I am developing an app which is similiar to android facebook app.
I got an created time field from facebook app
"created_time": "2012-11-28T12:53:40+0000",
So, how can I convert this into date format of android facebook app,like
2hours ago,
yesterday at 5:30pm etc
Try this:
And a helper method for this bit here:
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ");isI derived this code block from the
StreamRenderer.javain the Facebook SDK exmples on GitHub here: https://github.com/facebook/facebook-android-sdk/blob/master/examples/stream/src/com/facebook/stream/StreamRenderer.java (Check Line No. 380 onwards)It does not deal with the scenario yesterday at 5:30pm. But this should get you started.