G
Guest
Hi just wondering if anyone had any ideas on how to do this in C#.
I am trying to get the total time of several start and stop time data
entries. For example the input data looks like
starttime endtime
3:00pm 4:00pm
6:00pm 7:00pm.
6:30pm 7:00pm
3:00pm 3:30pm
It would be easy but I do not want to count any overlapped times. For
example for the data above I would want a sum of 2 hours, not counting the
6:30-7:00 segment and the 3:00-3:30 segment. Most of the data is more
complexed than the example above, more data entries with several different
overlaps. I currently have a loop and am comparing the current entry with
the previous entries. This works ok until I get to the 3:00-3:30 segment as
it does not know to not count it since it is only comparing it with the
6:30-7:00 segment.
thanks!
I am trying to get the total time of several start and stop time data
entries. For example the input data looks like
starttime endtime
3:00pm 4:00pm
6:00pm 7:00pm.
6:30pm 7:00pm
3:00pm 3:30pm
It would be easy but I do not want to count any overlapped times. For
example for the data above I would want a sum of 2 hours, not counting the
6:30-7:00 segment and the 3:00-3:30 segment. Most of the data is more
complexed than the example above, more data entries with several different
overlaps. I currently have a loop and am comparing the current entry with
the previous entries. This works ok until I get to the 3:00-3:30 segment as
it does not know to not count it since it is only comparing it with the
6:30-7:00 segment.
thanks!