I have a timesheet app that takes in two sets of time in the following format hh:mm tt
example:
StartTime = 1:00 AM
EndTime = 1:15 PM
TotalHours = 12.25
I get these result because of the following code
The issue I have is that if the following scenario happensCode:CDate(strEndTime).Subtract(CDate(strStartTime)).TotalHours
example:
StartTime = 10:21 PM
EndTime = 2:21 AM
TotalHours = -20.00
Instead of it displaying 4 hours it display -20. It is possible that someone working the second shift would work from 10:21 PM to 2:21 AM.
How can I correct this issue?




Reply With Quote