CipherIS
asked on
C# Calculate the duration between two hours
I need to calculate the duration between two hours. User is entering Start Time and End Time. As an example:
Start Time = 12:00 PM
End Time = 2:00 PM
Duration = 2 Hrs
Any ideas?
Start Time = 12:00 PM
End Time = 2:00 PM
Duration = 2 Hrs
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
figured it out - thx
DateTime.Parse(StartTime); or try parse should give you what you want..
you will probably want to do some bad format testing before you try to parse but try parse will help you do that
you will probably want to do some bad format testing before you try to parse but try parse will help you do that
DateTime.TryParse
ASKER