Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table, in which I store timeclock data (employee id, employee punch in time and date, employee punch out time and date).
See Sample attached.
All employees who work more than 5 hours in a single shift, qualify for a 30 minute paid lunch break.
In the example below, records 1 and 5 would qualify for a lunch break.
Record 1 is easy to adjust.
However, record 5 spans across two days (3 hours on 01/10/2016 and 3.5 hours on 1/11/2016). In these situations, I need to subtract 30 minutes from Hours Worked on a day with more hours worked (1/11/2016).
Following the adjustment, Hours worked would be: 3 hours on 01/10/2016 and 3 hours on 1/11/2016.
How can I accomplish this in script?
Thank you very much in advance!
Marcin
See this discussion: Task/Ticket Duration
or this one: Calculate hours between two Date/Time strings