...

View Full Version : date format help.



Idfk
12-09-2010, 10:50 PM
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";
}
?>

Fumigator
12-09-2010, 11:32 PM
It returns



few seconds ago


Anything else you want me to run for ya?

Idfk
12-10-2010, 01:14 AM
It returns



few seconds ago


Anything else you want me to run for ya?

I know & i need to get it fixed lol you know how to fix it?

Fumigator
12-10-2010, 04:11 AM
It's doing just what it says to do.

Idfk
12-10-2010, 04:12 AM
Fixed it....

Thanks anyway.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum