I need to calculate the amount of time a person has been operating a piece of machinery for to the following rule...

"No person may operate the machine for more than 4 hours of any 6 hour period at any time"

The time frame is 24 hours and the there are 4 operators.
The calculation for total operating time per person is simple enough for the first 6 hours but once the time passes 6 hours the target is constantly moving.
I will have a start time and end time for each persons operating stint, I want to calculate their "ON" time for any previous 6 hour period (i.e. NOW - 6 hours) and I also want to calculate the current operators total on time in the previous 6 hours from any given time (it will always be NOW - 6 hours).

If someone can help me that would be greatly appreciated!