G’day there!
I have task like show how many time was gone from message was created. For example, I send message 5 mins ago, I have time in long and I need to show message “5 mins ago”.
I get current date from System.currentTimeMillis() and do sub of date when message was created, but how can I get message like “5 mins ago” I don’t know.
Could you help me?
You know that your long that represents the change in time is in milliseconds (assuming both the original message created timestamp and the current timestamp were both created via System.currentTimeMillis()).
You can then use simple math to convert milliseconds to minutes.
1,000 milliseconds = 1 second, so 60,000 = 1 minute.
Where exactly were you getting stuck with this?