Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A few steps should easily fix this:</p> <ol> <li><p>Check the logout time - see if it is between 7am and 7pm (The hour method gives you the number of hours since midnight. You want to see if it is >=7 and &lt;=19). If it is not, move the time forward to 7am. Should be easy enough to do - If the time is &lt;7am, change the time to 7am. If the Time is greater than 7pm, change the time to 7am the next day</p></li> <li><p>Check the login time - see if it is between 7am and 7pm. If it is not, move the time back to 7pm. Should be easy enough to do - If the hour >7pm, set it to 7pm, if the hour is &lt;7am, change the time to 7pm on the previous day</p></li> <li><p>Check to make sure logout time &lt; login time. If not, the entire time logged out was during the none counting hours, so your time span should be set to 0. If your logout time &lt; login, just subtract them to get your timespan</p></li> </ol> <p>This for the situation described in the comment:</p> <p>If the day numbers are the now the same these are the steps I would take:</p> <ol> <li><p>Create a new datetime with the logout outs date, and a time of 1900. Subtract the new date from the logout date - this will give you the timespan until the end of day</p></li> <li><p>Move the logout date to 7am the next day. If the logout and the login are now on the same day, just subtract the logout from the login, this is the timespan for that day. If they are not the same date, repeat step 1</p></li> <li><p>Add the timespans generated in step 1 and step 2 together. This gives your total time</p></li> </ol> <p>For example: I logout Jan 1, at 16:00. I login Jan 2, at 10:00</p> <p>The time I was logout on Jan 1 during tracking hours is 3hours (Jan 1, 19:00 - Jan 1, 16:00)</p> <p>I move the logout time to Jan 2, at 07:00.</p> <p>The day of logout is 2, and the day of login is 2, now I can subtract them</p> <p>The time I was logout in Jan 2 during tracking hours is 3hours (Jan 2, 10:00 - Jan 2, 07:00)</p> <p>I now add them together and get 6hours of logout time during tracking hours.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload