Created
November 17, 2016 18:22
-
-
Save AlexBolotsin/ad2fe5a64be086f5da023079871702c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QString time_str1 = "02:43:02.343"; // .343 | |
QString time_str2 = "02:43:07.176"; // .643 | |
QDateTime time1 = QDateTime::fromString(time_str1, "hh:mm:ss.zzz"); | |
QDateTime time2 = QDateTime::fromString(time_str2, "hh:mm:ss.zzz"); | |
qint64 diff = time1.msecsTo(time2); | |
int seconds = diff / 1000; | |
int msec = diff % 1000; | |
qDebug() << "HEre is your time" << seconds << msec; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment