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 in visual basic
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 in visual basic
Here is an example that works fine:
Option Explicit Private Sub Form_Load() Dim Date1 As Date, Date2 As Date Date1 = Now() Wait 2 'wait 2 seconds Date2 = Now() MsgBox DateDiff("s", Date1, Date2) End Sub Private Sub Wait(delay As Integer) Dim r As Single r = Timer Do DoEvents Loop Until Timer r + delay End Sub "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 | |
|
|