koobelek@hotmail.com Guest
|
Posted: Wed Jul 13, 2005 7:55 pm Post subject: Work time + breaks |
|
|
I have the start time and the stop time (I will refer to it later as
the work time), two 15 minutes breaks and one lunch break (30 min). I
know how to calculate the difference between two times. I'm wondering
though, how to check if the breaks have occurred within the work time.
Moreover, the number of the 15 min. breaks may vary. I would appreciate
any suggestions.
Example:
CsNumOfBreaks = 10; // const
tmBreaks : array[1..csNumOfBreaks,1..2] of TDateTime; //not sure about
this declaration, but let's assume that it is correct
edStartTime.Text := '8:50 AM';
edStopTime.Text := '3:45 PM'; // total work time: 415 min (6.92
hrs)
tmBreaks[1,1] := '9:00 AM'; // break start
tmBreaks[1,2] := '9:15 AM'; //break stop
tmBreaks[2,1] := '11:30 AM'; // lunch start
tmBreaks[2,2] := '12:00 PM'; // lunch stop
tmBreaks[3,1] := '2:00 AM'; // break start
tmBreaks[3,2] := '2:15 AM'; //break stop
// total break time: 60 min
// check if all the breaks within the work time?
// worktime = 415
// breaktime = 60
// totalworktime = worktime - breaktime (355 min/5.92 hrs)
Regards,
Kooobel
|
|