QDateTimeEdit bad format
Solved
General and Desktop
-
Hello, i have a simple QDateTimeEdit with format yyyy/MM/dd hh:mm
when i call dateTimeEdit->setDate(QDate::currentDate());
i see 17y/06/20, why year is badly formatted?
Thank you -
Hello koahning, this is format from .ui
<property name="displayFormat">
<string>yyyy/MM/dd hh:mm</string>
</property>
Also in designer preview this is shown correct -
Works for me...
#include <QDateTimeEdit> int main(int argc, char *argv[]) { QApplication app(argc,argv); QDateTimeEdit w; w.setDisplayFormat(QStringLiteral("yyyy/MM/dd hh:mm")); w.setDate(QDate::currentDate()); w.show(); return app.exec(); }
-
-
This was a stupid issue, i realized just now that format string was translated with wrong translation.
there was a missing "y".
thank you all -
7/7