There is data from the СКУД . This is the время входа and время выхода . The working hours of the organization from 8 до 17:00 (lunch does not count) There are variables - таймаут1 - 25 минут and таймаут2 - 55 минут (I will explain below why they are). It is necessary to calculate the actual time of work. Hours of organization "Horns and hoofs" from 08:00 to 17:00
Suppose a man came at 8:01 and left at 17:40 . Since he arrived at 8:01 and the number of minutes is 01 < 25(таймаут1) , the entrance time will be 08:00 . Time out 17:40 . 40 > 25(таймаут1) but less than 55(таймаут2) - therefore round up to 30 (up to half an hour). It turns out that the actual time from 08:00 to 17:30 . This is the simplest algorithm and its transfer to the code will not be a problem.
Problems arise if there is a clock in the arrival or departure time.
Suppose if a person came at 10:25 and left at 16:45 . How to calculate its actual time?
TimeSpanand at the right intervals. Or something wrong? - Zufir