Hi there.
I am trying to find the average time it takes for a user to do a certain action. The time/date of this action takes place earlier up the script, and it returns the $DayCount[] array. This array basically contains the month ['Mo'], day ['D'] etc.
$Returned['TheDate'] is a unix timestamp
$Total is where i what will contain the total number of days...
<?php
$Total[$i] += (((($Returned['TheDate'] - mktime($DayCount['H'], $DayCount['Mi'], 0,$DayCount['Mo'],$DayCount['D'],$DayCount['Y'])) / 60) / 60) /24);
// @ to remove div. by 0 error
@$Average[$i] = round($Total[$i] / $Days[$i]);
?>
The problem i am having is that the only result to be returned reasonably correctly (correct result) is one that has a large difference between timestamps, the problem is that it is a negative number!
The ones where there is a difference of around an hour or so, it returns 10
Any ideas?
Thanks!