May 18, 2009
I want to display the duration only Hour, Minutes, and Second in data Gridview by Subtract TimeCheckOut from TimeCheckIn in ASP.NET using LINQ to SQL Here is code behind:
View 3 Replies
In Line 3 in function, Dim dif as TimeSpan = DateTime.Now.Subtract(Duration) which give only the duration of Hour, Minute, and Second from TimeCheckIn until DateTime.Now. However, I want to have the duration from TimeCheckIn until TimeCheckOut only in Hour, Minute, and Second.
I know that the FieldDisplayDuration function is totally wrong logic, but I just want you to get my point only, and also it could be the code sample for those who want to calculate the duration of the employee from the hire date. Finally, Let's get back to TimeSpan by Subtract TimeCheckOut from TimeCheckIn in gridview problem, How can I do that?