Solved How to get UTC date and time as y,M,d,h,m,s integers?
-
Hi there,
in QDateTime I was only able to get date and time in QString format yet. But struggle to get integer formated values.
What is generally the simplest way to get UTC date and time in Qt in integer format like:
int year = 2020;
int month = 7;
int day = 30;
int hour = 10;
int minutes = 18;
int seconds = 12;Best regards,
mireiner -
QDateTime dt(QDateTime::currentDateTime()); qDebug() << dt.date().year() << dt.date().month() << dt.date().day() << dt.time().hour() << dt.time().minute() << dt.time().second();
-
QDateTime dt(QDateTime::currentDateTime()); qDebug() << dt.date().year() << dt.date().month() << dt.date().day() << dt.time().hour() << dt.time().minute() << dt.time().second();
-
Hello J.Hilk,
that was fast and helped alot.
Thank you very much!