C++ How to add 1 more day to QDateTimeEdit?
-
I can print the current time in QDateTimeEdit.
In addition, I want to add1 day more than the current time in the other QDateTime edit part, how can I do that?
here is my code.
ui->datetmestartedit->setDateTime(QDateTime::currentDateTime()); //example 26/11/2022 18:45:00 ui->datetimeEndedit->setDateTime(QDateTime::currentDateTime()); //example 27/11/2022 18:45:00 here I want add +1 day to current date timehow can I do that?
-
I can print the current time in QDateTimeEdit.
In addition, I want to add1 day more than the current time in the other QDateTime edit part, how can I do that?
here is my code.
ui->datetmestartedit->setDateTime(QDateTime::currentDateTime()); //example 26/11/2022 18:45:00 ui->datetimeEndedit->setDateTime(QDateTime::currentDateTime()); //example 27/11/2022 18:45:00 here I want add +1 day to current date timehow can I do that?
@TheCeylann said in C++ How to add 1 more day to QDateTimeEdit?:
how can I do that?
By simply looking into the documentation: https://doc.qt.io/qt-6/qdatetime.html#addDays
-
@TheCeylann said in C++ How to add 1 more day to QDateTimeEdit?:
how can I do that?
By simply looking into the documentation: https://doc.qt.io/qt-6/qdatetime.html#addDays
@Christian-Ehrlicher Thank you for answer.