954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

time difference in vb6

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

guru511
Light Poster
42 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

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:)

manoshailu
Junior Poster
105 posts since Jun 2007
Reputation Points: 34
Solved Threads: 10
 

thanks buddy!!! that was useful to me !!! :):)

piyush25.2009
Newbie Poster
2 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You