Hi Jim,
To subtract two DataTime instances, you can use the Subtract method of the DataTime class like in the following example:
Dim date1 As New System.DateTime.Now
Dim date2 As New System.DateTime.Now
Dim diff1 As System.TimeSpan
diff1 = date2.Subtract(date1)
For more information, see the on-line help topic:
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdatetimeclassop_subtractiontopic.htm
>All,
>
> I am creating a webform that will be used to track time for project tasks. The user will click a button when a task is started and when it is completed. Then they will click another button to calulcate the total time for the task. I need to know how to calculate the time. Is there a function to do this? Are there any articles that explain how to do this with .net? Is there a better way to do this?
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi