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

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

thanks for code , how to get datetime function ??
pls needed
regards
lalith

how to get datetime function ??

for this , you should create a new thread with appropriate title.