Hi,
I am looking for a function which gives me the difference between two DateTime objects. in hour or minutes.
OR
Just give me the difference between them in seconds.
Hi,
I am looking for a function which gives me the difference between two DateTime objects. in hour or minutes.
OR
Just give me the difference between them in seconds.
Always Believe in Urself
Merry
Actually i want to calculate the difference between current time and the UTC time ,
i use the following code for that.........
QDateTime firstDateTime = QDateTime::currentDateTime();
QDateTime lastDateTime = QDateTime::currentDateTime().toUTC();
QString o_r = firstDateTime.toString("yyyyMMddhhmmss");
QString p_r = lastDateTime.toString("yyyyMMddhhmmss");
seconds = firstDateTime.toTime_t() - lastDateTime.toTime_t();
// seconds = firstDateTime.secsTo(lastDateTime);
But seconds like this comes as 0 .Because both the times are converted to UTC before the calculation,and hence trhe result.
My concern how to find the difference between current time and UTC time.
Always Believe in Urself
Merry
Bookmarks