i m making facebook app n i m getting update\_date=2011-03-23T04:30:43+0000 in this formate now i want time ago same as facebook in browser from this date .. i m using date formate its working fine in morning but after 5.30 it is not working fine. i think its problem in GMT but i cant find any solution so plz help me...

thanks in advance..
CapDroid.

I am using this code...
where str = 2011-03-23T04:30:43+0000

```
static public String dateformate(String str)
{

SimpleDateFormat form = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+SSSS");

java.util.Date date = null;
try 
{
    date = form.parse(str);
}
catch (ParseException e) 
{
    e.printStackTrace();
}
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("India"),Locale.getDefault());

calendar.set(Calendar.DATE,date.getDate());
calendar.set(Calendar.MONTH,date.getMonth());
calendar.set(Calendar.YEAR, date.getYear()+1900);
calendar.set(Calendar.HOUR,date.getHours());
calendar.set(Calendar.MINUTE,date.getMinutes());
calendar.set(Calendar.SECOND,date.getSeconds());

final long current = System.currentTimeMillis();
final long update = calendar.getTimeInMillis();
final long timeago = Math.abs(current-update);
if(timeago<=60000)
{
    int time = (int)(timeago/1000);
    return Integer.toString(time)+" seconds ago"; 
}
else if(timeago<=3600000 && timeago>=60000)
{
    int time = (int)(timeago/60000);
    return Integer.toString(time)+" minutes ago";
}
else if(timeago<=86400000 && timeago>=3600000)
{
    int time = (int)(timeago/3600000);
    return Integer.toString(time)+" hour ago";
}
}

```