This question has already been answered:
There is a QString
string with the starting date 2014.08.16 10:14:33
, then there is a list of three dates (there may be more), for example:
2014.08.17 17:28:53
2014.08.16 10:27:37
2014.08.15 12:33:17
How to find the closest date from this list to the start date? Those. in the end, it should turn out: the closest date to the original is the line 2014.08.16 10:27:37
. As I understand it, you need to somehow translate strings in QDateTime
and then compare them with the initial date, which is closer to the initial one, which we derive. What will this algorithm look like?