Solved How to get the date from QDateEdit in XXXX-XX-XX format?
-
QDate date = ui->dateEdit->date(); std::string strDate = date.toString().toStdString();
How can I store the date in XXXX-XX-XX format as string?
-
strDate = date.toString("yyyy-MM-dd").toStdString();
Other options and different formats are shown here:
https://doc.qt.io/qt-5/qdate.html#toString-4 -
strDate = date.toString("yyyy-MM-dd").toStdString();
Other options and different formats are shown here:
https://doc.qt.io/qt-5/qdate.html#toString-4