QDateTime: How to hold dates before 1-1-1970?
-
Hi,
What version of Qt are you using ?
QDateTime dateTime(QDate(1900, 12, 12)); qDebug() << dateTime;
returns
QDateTime(1900-12-12 00:00:00.000 CET Qt::LocalTime)
as expected. -
Hi,
What version of Qt are you using ?
QDateTime dateTime(QDate(1900, 12, 12)); qDebug() << dateTime;
returns
QDateTime(1900-12-12 00:00:00.000 CET Qt::LocalTime)
as expected. -
I misunderstood after reading lines like this in the documentation: "A datetime can also be set using the setMSecsSinceEpoch() function that takes the time, in milliseconds, since 00:00:00 on January 1, 1970". I should have just tried instantiating a date like @SGaist did. Like @JonB said, the 1970 seems to apply only those functions he stated. Thanks for clarifying.