If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
time calculation
hi,
could u pls help me to subtract one time value from another in visual basic? i've tried using the datediff function but it doesn't give me the required results. i've used the now function to generate two different system times and i want to subtract one from the other and display the time elasped. how do i go about it?? |
#2
|
|||
|
|||
time calculation
koko wrote:
hi, could u pls help me to subtract one time value from another in visual basic? i've tried using the datediff function but it doesn't give me the required results. i've used the now function to generate two different system times and i want to subtract one from the other and display the time elasped. how do i go about it?? Here's one that uses DateDiff to get what I think you're after... Subject: Time Difference between two times in (HH:MM:SS) format http://groups.google.com/groups?selm...&output=gplain -- Ken Halter - MS-MVP-VB - http://www.vbsight.com Please keep all discussions in the groups.. |
#3
|
|||
|
|||
time calculation
Hi Koko,
Do it like this: Dim time1 As Date, time2 As Date, interval As Long time1 = Format(Now, "HH:mm:ss") MsgBox "Wait a while." time2 = Format(Now, "HH:mm:ss") interval = DateDiff("s", time1, time2) MsgBox "The MessageBox was displayed from " & time1 & " until " & time2 & ". an elapsed time of " & interval & " seconds." -- Please post any further questions or followup to the newsgroups for the benefit of others who may be interested. Unsolicited questions forwarded directly to me will only be answered on a paid consulting basis. Hope this helps Doug Robbins - Word MVP "koko" wrote in message ... hi, could u pls help me to subtract one time value from another in visual basic? i've tried using the datediff function but it doesn't give me the required results. i've used the now function to generate two different system times and i want to subtract one from the other and display the time elasped. how do i go about it?? |
Thread Tools | |
Display Modes | |
|
|