I have this code, which, in my opinion, should tell me the time of the computer.
#include <QTextStream> #include <QDate> #include <QTime> int main(void) { QTextStream out(stdout); QDate dt2; dt2.setDate(QDateTime::currentDateTime()); out << dt2.toString("yyyy/MM/dd") << endl; } Unfortunately, this code does not work. where is my mistake?