time difference in vb6

Reply

Join Date: Jul 2007
Posts: 42
Reputation: guru511 is an unknown quantity at this point 
Solved Threads: 3
guru511's Avatar
guru511 guru511 is offline Offline
Light Poster

time difference in vb6

 
0
  #1
Aug 8th, 2007
hi,
how to get the time difference in vb6

exp;

dt1 = now() ' dt1=08/Aug/07 12:57 PM
dt2=some date n time

now i want to find the difference between these two in terms of time...
can u plz tell me how to do that
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 95
Reputation: manoshailu is an unknown quantity at this point 
Solved Threads: 9
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Re: time difference in vb6

 
0
  #2
Aug 8th, 2007
hi,

u can find difference between date and time by using datetime function.

Try the below coding:

'To find Days

DateTime.DateDiff("d",Text1.Text,now)


'To find Months

DateTime.DateDiff("m",Text1.Text,now)


'To find Years

DateTime.DateDiff("y",Text1.Text,now)


'To find Hours

DateTime.DateDiff("h",Text1.Text,now)


'To find Minutes

DateTime.DateDiff("n",Text1.Text,now)


'To find Seconds

DateTime.DateDiff("s",Text1.Text,now)

Regards
Shailu
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC