Could anyone please tell me how do I find the TIME difference between any given number of times based on certain condition?
e-g
Find the "later" time between the given DateTimes below e-g it would be 2010-10-22 08:10:46.053 in this case because it is the latest time out of the four given date times.
Find the "earlier" time between the given DateTimes below e-g it would be 2010-10-22 06:45:46.053 in this case because it is the earliest time out of the four given date times.
Then find the time difference between the two times i-e between the earliest and the latest time. Date would always remain the same. Difference occurs only in the TIME part of a given DateTime.
The pairs/groups of DateTimes are stored in a vector.
They are stored as time_t and sorted from latest to earliest time. Is retrieving the first and last elements of this sorted vector through front() and back() a good approach? and then finding the difference between those two times.