I would like to calculate the a time interval between two time points in hourly based (calculate working hours for employees). For instance,
Start Time 4/11/2014 9:00
End Time 5/11/2014 10:00
For this case, the result should be 9 hours (since the time slot for employee is 09:00-13:00,14:00-18:00, 8 hours each day).
However, I would like remove the weekend hours from my time interval. For example,
Start Time 31/10/2014 9:00
End Time 3/11/2014 10:00
In this case, the answer should be 9 hours as well, since Nov 1st and 2nd are Sat and Sun respectively.
How could I achieve this goal using R programming. Sincerely thanks for reply.
4/11/2014 9:00
4/11/2014 10:00 expected result: 14/11/2014 9:00
4/11/2014 15:00 expected result: 54/11/2014 9:00
4/11/2014 18:00 expected result: 84/11/2014 9:00
5/11/2014 10:00 expected result: 931/10/2014 9:00
3/11/2014 10:00 expected result: 9