the_black_code
Registered User.
- Local time
- Today, 23:26
- Joined
- Jul 19, 2010
- Messages
- 14
Dear All,
I am currentley working on a function that can calculate the deferance between two gevin times and return the result
. My code is as follow:
But when I entered the time values (IN: 11:45:00) and (OUT: 17:00:00) it returnes 06:45:00
...
Please could anyone help me with this and I would be appreciated.
Thanks.
A
I am currentley working on a function that can calculate the deferance between two gevin times and return the result

Code:
Public Function TimeDiffCal(ByVal StartingTime As Date, ByVal FinishingTime As Date) As Date
Dim BTime As Variant, ETime As Variant
Dim Hours As Integer, Minutes As Integer, Seconds As Integer
BTime = Split(CStr(StartingTime), ":")
ETime = Split(CStr(FinishingTime), ":")
Hours = Abs(ETime(0) - BTime(0))
Minutes = Abs(ETime(1) - BTime(1))
Seconds = Abs(ETime(2) - BTime(2))
TimeDiffCal = CDate(Hours & ":" & Minutes & ":" & Seconds)
End Function
But when I entered the time values (IN: 11:45:00) and (OUT: 17:00:00) it returnes 06:45:00

Please could anyone help me with this and I would be appreciated.
Thanks.
A