Greetings,
I am trying to write an application where I can keep track of the time worked during the day. Say I entered in 7:03am and finished at 12:21pm and then back 1:21pm and finished for the day at 5:30pm. I would like it calculate the total time worked and time taken for lunch and store that in a database.
I tried searching for this on the web for some sample code, but none seem to do exactly what i am looking for, I know it is using the datediff function in some shape or form. so any help would be appreciated. Thanks.
Dim strStart As String = "7:21:00 AM"
Dim strEnd As String = "12:59:00 PM"
MsgBox(DateDiff(DateInterv
al.Hour, CDate(strStart), CDate(strEnd)))
MsgBox(DateDiff(DateInterv
al.Minute,
CDate(strStart), CDate(strEnd)))
When I try to do it with the code above, I get mixed results. May be what I want is not possible, but I would think this is something that can be done, but but I am either looking in the wrong place or something else.
Start Free Trial