Time between dates
Hi,

I have two dates:

2016/04/19 12:52

and

2016/04/19 13:50

It's just example dates and it's strings. How to calculate difference in minutes? that here is 58 min difference
First use sscanf to parse the strings.

sscanf(datetime1, "p</:>iiiii", y, m, d, h, m)
sscanf(datetime2, "p</:>iiiii", y, m, d, h, m)

Then determine the time stamp of each from the given times. Subtract the time stamp. Boom, there you go, the new time stamp is your answer. Just convert it back to time and date.

I'd provide more code but I'm on my phone at the moment.
How convert it into time stamp?
`new ts1, ts2, ts;// Get the time from each stringsscanf(datetime1, "p</:>iiiiii", y1, m1, d1, h1, mi1, s1);sscanf(datetime2, "p</:>iiiiii", y2, m2, d2, h2, mi2, s1);// Convert the times to timestampsdatetime2stamp(ts1, y1, m1, d1, h1, mi1, s1);datetime2stamp(ts2, y2, m2, d2, h2, mi2, s2);// Get the timestamp differencets = (ts2 > ts1 ? ts2 - ts1 : ts1 > ts2 ? ts1 - ts2 : 0);// Get the time difference from the timestampTimeInSeconds(ts, y, m, d, h, mi, s); // This is the answer`