Using the wall.get method, I get a wall. How do I get the text as in VC. Tipo 3 minutes ago. 10 minutes ago. etc.

Just there is no such parameter. There is only a date in UTC format.

long datePost=System.currentTimeMillis()/1000; datePost=datePost-Integer.valueOf(arrayDate.get(position)); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); String d = sdf.format( datePost ); textDate.setText(d); 
  • 3
    Hands, of course. - VladD
  • one
    the current date given in the UTC belt minus the date of the post and will be yours 3 minutes ago - Vladyslav Matviienko

1 answer 1

It is very unlikely that any service will ever return data of this kind. Only the record creation time will always be returned. Displaying the difference in creation time from the current time you need to implement yourself.

To do this, take the current time of the device and subtract from it the time to create a record. Do not forget that the time zones were identical for both values.

  • Nothing works. It must be 25 minutes. But it turns out 05:00 - Vasya
  • @ Vasya, you don’t need to divide by 1000. Try the opposite, if the VC seconds gives you multiply them by 1000 to get milliseconds. And it is them to subtract from the system time. - Yuriy SPb