jaybones Posted April 29, 2007 Share Posted April 29, 2007 Right now i have this: <? echo vdate($atackA1[$i]->time); ?> on php site it shows: 19:49 19:48 19:48 19:47 19:47 01:07 Apr 25, 2007 Apr 24, 2007 When it shows date(Apr 25, 2007) thats fine. but instead of it have 19:49 i want how many minutes ago that was. How can i do this? Link to comment https://forums.phpfreaks.com/topic/49149-tring-to-format-time/ Share on other sites More sharing options...
genericnumber1 Posted April 29, 2007 Share Posted April 29, 2007 I'll leave it up to you to use this simple concept yourself... <?php $fiveminsago = time() - 300; echo round((time() - $fiveminsago) / 60) . ' mins ago'; ?> Alternatively you could use ceil() or floor() instead of round() Link to comment https://forums.phpfreaks.com/topic/49149-tring-to-format-time/#findComment-240797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.