Unix timestamp
Solved
General and Desktop
-
wrote on 21 Nov 2015, 18:27 last edited by
Hello,
I am trying to get a current Unix time stamp in my QT application but it outputs a wrong date.
QDateTime asd; uint unixTime = asd.toTime_t(); qDebug() << unixTime;
It outputs: 4294967295 which is 02/07/2106.
Why does it output 91 years into the future? How do I make it output the current Unix time stamp? -
wrote on 21 Nov 2015, 18:52 last edited by
Hi, try
QDateTime asd(QDateTime::currentDateTime()); uint unixTime = asd.toTime_t(); qDebug() << unixTime;
-
Hi, try
QDateTime asd(QDateTime::currentDateTime()); uint unixTime = asd.toTime_t(); qDebug() << unixTime;
wrote on 21 Nov 2015, 21:20 last edited by@hskoglund This did the trick, thank you.
1/3