|
-
October 28th, 1999, 02:19 AM
#1
Time Diff
Dear all,
I have two times captured in a table using the 'time' command. I know how to work out the time in minutes, seconds, and hours....but i wanted to say return me the time difference in hours, minutes and seconds....without ending up with 1856 seconds difference.....i wanted say 2 mins 30 seconds....can anyone pls help.
-
October 28th, 1999, 03:14 AM
#2
Re: Time Diff
Here is some VB 6 sample code to calculate the datetime difference between 2 dates.
private Sub Command1_Click()
Dim d1 as date
Dim d2 as date
d1 = #10/26/1999 12:00:00 PM#
d2 = #11/15/1999 2:15:00 PM#
Dim diff as date
diff = d2 - d1
MsgBox Day(diff) & " days " & Hour(diff) & " hours " & Minute(diff) & " minutes"
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|