Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining Time Elapsed
Message
From
14/04/2007 18:41:29
John Baird
Coatesville, Pennsylvania, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01215950
Message ID:
01215962
Views:
10
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,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform