1 Reply Latest reply: Nov 15, 2016 11:51 AM by Gysbert Wassenaar RSS

    Working with timestamps

    marcin szuberla

      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.

      33.PNG

      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