
Originally Posted by
Laszlo
For all those people who have problems with the time offsets in total time and and idle time, the problem is the code that generates the html there is poorly written.
It is towards the end of admin/user_tracking.php, search for "28800".
The person who wrote this code used 28800 seconds (8 hours) offset as that presumably suited their timezone. With a bit of experimenting you can figure out what value works for you (provided you site runs on servers in the same timezone only).
The real solution is to change this code to be timezone neutral (work in every timezone).
I recently had to install this mod for someone so I had a look at this bug. It is caused because the code is using the date() function to format something that is not a timestamp. To fix the code fully edit admin/user_tracking.php and then change the line (at about line 324) that says...
PHP Code:
<td class="dataTableContent" colspan="2" valign="top"><?php echo date('H:i:s', (time() - $ut['value']['end_time']+ 28800)); ?></td>
..to..
PHP Code:
<td class="dataTableContent" colspan="2" valign="top"><?php $dt=time() - $ut['value']['end_time']; printf("%02d:%02d:%02d",$dt/3600, ($dt % 3600)/60, $dt % 60); ?></td>
...and the line (at about line 330) that says...
PHP Code:
<td class="dataTableContent" colspan="2" valign="top"><?php echo date('H:i:s', ($ut['value']['end_time'] - $ut['value']['time_entry'] + 28800)); ?></td>
...to...
PHP Code:
<td class="dataTableContent" colspan="2" valign="top"><?php $dt=$ut['value']['end_time'] - $ut['value']['time_entry']; printf("%02d:%02d:%02d",$dt/3600, ($dt % 3600)/60, $dt % 60);?></td>
Hope that helps.
Regards,
Christian.
Bookmarks