I need the unix timestamp - the timestamp i have. Then display the time between like on twitter.
Asked
Active
Viewed 1,264 times
3 Answers
3
If you have the difference called diff:
$seconds = intval($diff) % 60;
$minutes = intval($diff/60) % 60;
$hours = intval($diff/3600) % 24;
$days = intval($diff/(3600*24));
Is this what you want ?

nc3b
- 15,562
- 5
- 51
- 63
0
Use example :
echo time_elapsed_string('@1367367755');
echo time_elapsed_string('@1367367755', true);
Output :
4 months ago
4 months, 2 weeks, 3 days, 1 hour, 49 minutes, 15 seconds ago