- Home
·
- String Manipulation
·
- I have found the DateDiff command to be very useful for working with dates but unfortunately there
I have found the DateDiff command to be very useful for working with dates but unfortunately there
I have found the DateDiff command to be very useful for working with dates but unfortunately there doesnt seem to be a TimeDiff function for
Rate I have found the DateDiff command to be very useful for working with dates but unfortunately there
(1(1 Vote))
'(C) Roderick Thompson, April 2001, KLIK4.COM Limited
Time1 = FormatDateTime(Time1, vbLongTime)
Time2 = FormatDateTime(Time2, vbLongTime)
HourTime1 = Hour(Time1)
HourTime2 = Hour(Time2)
MinuteTime1 = Minute(Time1)
MinuteTime2 = Minute(Time2)
SecondTime1 = Second(Time1)
SecondTime2 = Second(Time2)
Time1InSeconds = SecondTime1 + (MinuteTime1 * 60) + (HourTime1 * 3600)
Time2InSeconds = SecondTime2 + (MinuteTime2 * 60) + (HourTime2 * 3600)
TimeDifference = Time2InSeconds - Time1InSeconds
Select Case Interval
Case "h"
TimeDifference = TimeDifference / 3600
Case "m"
TimeDifference = TimeDifference / 60
End Select
TimeDiff = TimeDifference
End Function
I have found the DateDiff command to be very useful for working with dates but unfortunately there Comments
No comments yet — be the first to post one!
Post a Comment