[Qt-interest] Behavior of QDateTime.secsTo() Differs from QT's Documentation

Alex shao.tu at gmail.com
Fri Jun 4 05:47:30 CEST 2010


Hi,

Why the behavior of QDateTime.secsTo() differs from QT's documentation.

My code:
QDateTime last(QDate(1900, 1, 1));
QDateTime now = QDateTime::currentDateTime();
qDebug() << last.secsTo(now);

QT's documentation says:
int QDateTime::secsTo ( const QDateTime & *other* ) const

Returns the number of seconds from this datetime to the *other* datetime. If
the *other* datetime is earlier than this datetime, the value returned is
negative.


But after I run my code, it outputs a negative number (-810326525).
Can anybody tell me why?
Thanks!

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100604/161f680b/attachment.html 


More information about the Qt-interest-old mailing list