In the example below, diff.Minutes will show the elapsed time in minutes (assuming stopTime and startTime are valid DateTime values).
TimeSpan diff = (stopTime - startTime);
>I'm attempting to determine the elapsed time (in total minutes) between two datetime values in VB.Net (2005).
>
>In the web application, a student will "log in" which stores DateTime.Now to a datetime SQL Server 2000 field (STARTTIME).
>
>Later (could be a few minutes, hours, or even days), the student will complete what they are working on and will "log out" of the web application, so the app stores DateTime.Now to another datetime SQL Server field (STOPTIME).
>
>At this point, (in VB.Net, not in SQL) I'd like to determine just the number of minutes that have elapsed. In other words, the difference between STARTTIME and STOPTIME, expressed in minutes.
>
>I've been playing around with TimeSpan and AddMinutes, etc, but I'm not having much luck. Any suggestions are appreciated!
>
>Thanks,