I'm working on android app and trying to get created_time from facebook JSON. I was successful in that and I got it as 2011-07-14T12:28:52+0000 . 
Now this should be converted into long format like 220200202932093
My challenge now is to convert that into long format.
This is because i have planned to get relative time using getRelativeTimeSpanString in android.
Please help me to convert String formatted time from JSON object to long format
String exampleDateString = "2011-07-14T12:28:52+0000";
try 
{
    long timeMillis = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+SSSS")
        .parse(exampleDateString)
        .getTime();
} catch (Exception e) {
    e.printStackTrace();
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With