"yyyy-MM-dd hh:mm:ss" 格式的时间 例如2013-07-11 20:11:05
QDateTime dataTimeCurrentPCTime = QDateTime::currentDateTime();
两者如何做差得到秒数?
------解决方案--------------------
QDateTime time = QDateTime::fromString("2013-07-11 20:11:05", "yyyy-MM-dd hh:mm:ss");
int cha = dataTimeCurrentPCTime.toMSecsSinceEpoch() - time.toMSecsSinceEpoch(); 这里是毫秒级别的
int chaMiao = cha/1000;
------解决方案--------------------
学习了

------解决方案--------------------
就是这个函数:qint64 QDateTime::secsTo(const QDateTime & other) const
"yyyy-MM-dd hh:mm:ss" 格式的时间 例如2013-07-11 20:11:05
QDateTime time = QDateTime::fromString("2013-07-11 20:11:05", "yyyy-MM-dd hh:mm:ss");
qint64 sec = QDateTime::currentDateTime().secTo(time);
------解决方案--------------------