How do I compare two timestamps with format yyyy-mm-dd hh-mm-ss to get the total difference in minutes?
The timestamps are retrieved from MySQL. So far I’ve tried using time_t or even breaking down the whole string to compare but the problem with the latter is it doesnt recognize the difference in days.
thanks in advance!
edit1:
by comparing the timestamps i need to check whether the difference is bigger than x minutes.
like:
timestamp1 = getTimestampFunction1();
timestamp2 = getTimestampFunction2();
difference = timestamp1 - timestamp2; //difference in minutes
if (difference > 60)
{
do this;
}
else
{
do that;
}
This can be done with boost
The output is