I have trouble converting QDate to QString. See the code below:
cout << QString("\nBooking Date: %1").arg(QDate::toString(this->getBookingDate() &YYYY.mm.dd)
When I try to compile this it gives me:
‘YYYY’ was not declared in this scope
Yet the documentation says:
“Returns the date as a string. The format parameter determines the format of the result string…” and goes on to list the format strings.
I am new to Qt so if I am missing the obvious please excuse the ignorance.
You want
this->getBookingDate().toString("yyyy.MM.dd"). For further info, read the documentation.