How do I do division on HH:MM:SS format time strings in C#?
- by Jake
I have a series of times that are coming to me as strings from a web service. The times are formated as HH:MM:SS:000 (3 milisecond digits). I need to compare two times to determine if one is more than twice as long as the other:
if ( timeA / timeB > 2 )
What's the simplest way to work with the time strings?
If I was writing in Python this would be the answer to my question:
Difference between two time intervals in Python
Edit: What I'm really looking for is a way to get the ratio of timeA to timeB, which requires division, not subtraction. Unfortunately, the DateTime structure doesn't appear to have a division operator. Updated the question title to reflect this.