diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 167db2bb6a..f5d0cad42f 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -4019,8 +4019,7 @@ QString QDateTime::toString(Qt::DateFormat format) const If the datetime is invalid, an empty string will be returned. \note If localized month and day names are desired, please switch to using - QLocale::system().toString() as QDateTime methods shall change to use - English (C locale) names at Qt 6. + QLocale::system().toString() as QDateTime methods use English (C locale) names. \sa fromString(), QDate::toString(), QTime::toString(), QLocale::toString() */ diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index 233a33065e..c2c0fbd7d5 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -892,8 +892,8 @@ void tst_QDateTime::toString_textDate_data() QTest::addColumn("datetime"); QTest::addColumn("expected"); - QString wednesdayJanuary = QLocale::system().dayName(3, QLocale::ShortFormat) - + ' ' + QLocale::system().monthName(1, QLocale::ShortFormat); + const QString wednesdayJanuary = QLocale::c().dayName(3, QLocale::ShortFormat) + + ' ' + QLocale::c().monthName(1, QLocale::ShortFormat); QTest::newRow("localtime") << QDateTime(QDate(2013, 1, 2), QTime(1, 2, 3), Qt::LocalTime) << wednesdayJanuary + QString(" 2 01:02:03 2013");