date difference

  • Thread starter Thread starter vince
  • Start date Start date
You can use the Add and Substract methods of the DateTime class.
Dim a As DateTime = DateTime.Now
Dim b As DateTime = DateTime.Now

MsgBox(a.Subtract(b).ToString)


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
thanks , it works.

-----Original Message-----
You can use the Add and Substract methods of the DateTime class.
Dim a As DateTime = DateTime.Now
Dim b As DateTime = DateTime.Now

MsgBox(a.Subtract(b).ToString)


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan






.
 
DateTime d1 = new DateTime(2000, 7, 13);
DateTime d2 = new DateTime(2003, 12, 5);
TimeSpan s = d2 - d1;
int numberofdays = s.TotalDays;

A timespan contains a number of different ways to show the difference.
 
Back
Top