"weche" <fw****@videotron.ca> schrieb:
I would like to know how I can calculate the diference in time between 2
dates. I would input a date (before the current date) and the code would
calulate how many: weeks, days, hours, minutes and secondes there is
between
the given date and the current date.
\\\
Dim d1 As Date = Now
Dim d2 As Date = #4/22/1989#
MsgBox(CStr(Math.Round(d1.Subtract(d2).TotalSecond s, 0)))
MsgBox(CStr(DateDiff(DateInterval.Second, d2, d1)))
///
'DateTime.Subtract' will return a 'TimeSpan'. This structure provides
properties like 'Days', 'Minutes', 'Seconds', ...
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>