Hello, I am trying to get the amount of time logged in for the people that use my site. It works although I use date function to display the time which is in timestamp format therefore it always shows 1 hour e.g. if you have been logged in for 20min it would show 1.20 (1 hour 20 min or 20 past 1 as this is a date).
With this function the left most number can never be 0 therefore I must change the fucntionto something else.
I want the 1 to be a 0 and then when its past an hour, 1 whatever.
<?php
$loginTime = $_SESSION['loginTime'];
$time = (time() + (1 * 60 * 60));
$start_time = strtotime($loginTime);
$loggedInFor = ($time - $start_time);
?>
<br><?php echo "Logged in for: " .date("g:i",$loggedInFor);?></br>
Is there another function apart from date I can use to do this please.
Cheers anyone