Hallo,
In VB6 i used this function:
Function TimeDiff(ByVal inTime As String, ByVal outTime As String)
Dim ainTime As Date, aoutTime As Date
Dim mElapsed As Long
ainTime = Format(Right("0" & inTime, 4), "@@
@") ' right justify the inTime
aoutTime = Format(Right("0" & outTime, 4), "@@
@") ' right justify the outTime
TimeDiff = DateDiff("n", ainTime, aoutTime) ' calculate number of minutes elapsed
End Function
I can not seem to find any similar function in C#.
Is there any genies out there who can magically transform this one into a C# function.
The format I get from my users are ex. "0735" (began at work), and I then need to calculate minutes passed since "0000" (midnight"). In VB6 I then called TimeDiff(0000, 0735), and got 455, which is minutes between the two times.
All help and pointers will be greatly appreaciated!
Best regards,
Eirik Hesthamar
Norway
In VB6 i used this function:
Function TimeDiff(ByVal inTime As String, ByVal outTime As String)
Dim ainTime As Date, aoutTime As Date
Dim mElapsed As Long
ainTime = Format(Right("0" & inTime, 4), "@@
aoutTime = Format(Right("0" & outTime, 4), "@@
TimeDiff = DateDiff("n", ainTime, aoutTime) ' calculate number of minutes elapsed
End Function
I can not seem to find any similar function in C#.
Is there any genies out there who can magically transform this one into a C# function.
The format I get from my users are ex. "0735" (began at work), and I then need to calculate minutes passed since "0000" (midnight"). In VB6 I then called TimeDiff(0000, 0735), and got 455, which is minutes between the two times.
All help and pointers will be greatly appreaciated!
Best regards,
Eirik Hesthamar
Norway