Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

difference of two datetimes

Status
Not open for further replies.

atropozzz

Programmer
Mar 19, 2002
16
AT
hi everybody!

i got a quick question: can't find a function in vb.net with which i can calculate the difference of 2 given dates (in days). anybody got an idea?

thanx in advance!

atro
 
Hi,
The Same DateDiff functions is also there in VB.NET u can try this

Dim firstDate As Date
Dim secondDate As Date
firstDate = Now()
secondDate = Now()
firstDate = firstDate.AddDays(11)
MsgBox(DateDiff(DateInterval.Day, secondDate, firstDate))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top