ricky_vancouver Posted December 11, 2010 Share Posted December 11, 2010 Anyone know what's up with this? <?php $days = floor($posts['timestamp'] / (60 * 60 * 24)); $remainder = $posts['timestamp'] % (60 * 60 * 24); $hours = floor($remainder / (60 * 60)); $remainder = $remainder % (60 * 60); $minutes = floor($remainder / 60); $seconds = $remainder % 60; if($days > 0) { echo date("d/m/y", $posts['timestamp']); echo " at "; echo date("H:i", $posts['timestamp']); }elseif($days == 0 && $hours == 0 && $minutes == 0) { echo "few seconds ago"; }elseif($days == 0 && $hours == 0) { echo $minutes.' minutes ago'; }elseif($days == 0 && $hours > 0){ echo $hours.' hour ago'; }else{ echo "few seconds ago"; } ?> [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/221288-date-format-help/ Share on other sites More sharing options...
trq Posted December 11, 2010 Share Posted December 11, 2010 Not without a description of the problem. Link to comment https://forums.phpfreaks.com/topic/221288-date-format-help/#findComment-1145660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.