Hi
I need to calculate the total hours of an employee as follow:
1.Check in
2.Lunch in
3.Lunch out
4. Check out
is possible do math whitin times?
Thanks to all
Alan
Hi
I need to calculate the total hours of an employee as follow:
1.Check in
2.Lunch in
3.Lunch out
4. Check out
is possible do math whitin times?
Thanks to all
Alan
With classic framework, using date.Totalseconds.
[code] dim checkin as new date
dim lunchin as new date
dim lunchout as new date
dim checkout as new date
checkin.hour = 9
checkin.minute = 00
lunchin.hour = 12
lunchin.minute = 00
lunchout.hour = 13
lunchout.Minute = 30
checkout.hour = 17
checkout.Minute = 0
dim interval as new date(0, 0, 0, 0, 0)
interval.totalseconds = (checkout.TotalSeconds-lunchout.TotalSeconds) + _
(lunchin.TotalSeconds - checkin.TotalSeconds)
msgbox "hours worked : " + str(interval.Hour) + “:” + str(interval.Minute)[/code]
Thanks Michel
You save my day!
You’re welcome, Alan.