I will have the following variables in a mysql table for each day, i.e. each row stores the following datetime mysql variables:
Acutally now I am thinking about it, should each of these clockIn and clockOut mysql entries simply be a time data type instead of datetime? Since, each record is a single day, in theory I shouldnt need the date. Thanks for advice on this as well.
clockIn1 = 2006-06-15 09:00:51 clockOut1 = 2006-06-15 12:00:12 clockIn2 = 2006-06-15 13:00:18 clockOut2 = 2006-06-15 15:30:44 clockIn3 = 2006-06-15 15:45:23 clockOut3 = 2006-06-15 17:00:14 clockIn4 = 0000-00-00 00:00:00 clockOut4 = 0000-00-00 00:00:00 clockIn5 = 0000-00-00 00:00:00 clockOut5 = 0000-00-00 00:00:00
NOTE: clockIn and clockOut 4 and 5 were not used in this example but they could have been. Also the opposite is true, there may be a case where ONLY clockIn1 and clockOut1 are filled, the other 4 pairs of variables could be zeroed out.
How do I calulate the total amount of time in this example work day in hours:minutes:seconds from this data? Thanks guys!