Hello guys
so the helper turns into the helped… :-[ :-X
Ok, so i don’t have my math head on today and can’t figure this out, was hoping someone could help clear it up for me ;D
i have a row in my database that holds an integer (initial value=0).
as the user spends time on the site this is entered into table IE: 10mins = 600
this value will keep rising the more time the user spends on the site…
What i’m trying to do is display “You have spent X days X hours X mins on the site”
X being the correct value.
The formula i’m using is as follows:
[php]echo floor($total_time / 86400) . ’ days ';
echo floor($total_time / 3600) . ’ hours ‘;
echo floor($total_time / 60) . ’ minutes.’;
[/php]
It seemed to work fine initially (while the values where below the real life counterparts)
IE: stored value = 600 // outputs: 0 days 0 hours 10 minutes.
now the value is higher i’m getting unacceptable results:
IE: stored value= 96823 // outputs: 1 days 26 hours 1613 minutes
As you can see, 26 hours/1613 mins is not ideal so i’m lookin for either a math formula or PHP function to fix it…
Any help would be much appreciated as i just can’t count today
Red